Newbie question

i am coming from php and dont seem to quite understand how ruby works
with the browser. how does one implement ruby code into html code?

···

--
Posted via http://www.ruby-forum.com/.

You will need a framework like rails or sinatra to do web "stuff". I
recommend taking a look at rails, there are a lot of good tutorials online
to help get you started.

···

---
Buddy Lindsey

http://www.twitter.com/buddylindsey

On Wed, Aug 31, 2011 at 7:52 PM, sunny parker <info@2020proj.com> wrote:

i am coming from php and dont seem to quite understand how ruby works
with the browser. how does one implement ruby code into html code?

--
Posted via http://www.ruby-forum.com/\.

Have a look at this;

http://www.sinatrarb.com/
http://www.sinatrarb.com/intro.html

Sam

···

On 01/09/11 12:52, sunny parker wrote:

i am coming from php and dont seem to quite understand how ruby works
with the browser. how does one implement ruby code into html code?

ok, installed rails
gem install rails --include-dependencies
now what?

···

--
Posted via http://www.ruby-forum.com/.

had issues with this:

#!/usr/bin/ruby
puts "content-type: text/html\n\n"
puts "Hello World!"

fixed it with this:

#!/xampp-1.74/Ruby192/bin/ruby
puts "content-type: text/html\n\n"
puts "Hello World!"

···

--
Posted via http://www.ruby-forum.com/.

The php equivalent is erb - embedded ruby. Rails and Sinatra are. More equivalent to something like the cakephp framework.

Blog: http://random8.zenunit.com/
Twitter: http://twitter.com/random8r
Learn: http://sensei.zenunit.com/
New video up now at http://sensei.zenunit.com/
real fastcgi rails deploy process! Check it out now!

···

On 01/09/2011, at 10:52 AM, sunny parker <info@2020proj.com> wrote:

i am coming from php and dont seem to quite understand how ruby works
with the browser. how does one implement ruby code into html code?

--
Posted via http://www.ruby-forum.com/\.

+1 for Sinatra

···

On Wed, Aug 31, 2011 at 7:58 PM, Sam Duncan <sduncan@wetafx.co.nz> wrote:

Have a look at this;

http://www.sinatrarb.com/
http://www.sinatrarb.com/**intro.html&lt;http://www.sinatrarb.com/intro.html&gt;

Sam

On 01/09/11 12:52, sunny parker wrote:

i am coming from php and dont seem to quite understand how ruby works
with the browser. how does one implement ruby code into html code?

···

On Thu, Sep 1, 2011 at 3:10 AM, sunny parker <info@2020proj.com> wrote:

ok, installed rails
gem install rails --include-dependencies
now what?

--
Phillip Gawlowski

phgaw.posterous.com | twitter.com/phgaw | gplus.to/phgaw

A method of solution is perfect if we can forsee from the start,
and even prove, that following that method we shall attain our aim.
-- Leibniz

···

On Aug 31, 2011 9:11 PM, "sunny parker" <info@2020proj.com> wrote:

ok, installed rails
gem install rails --include-dependencies
now what?

--
Posted via http://www.ruby-forum.com/\.

Not necessarily. For simple tasks it might be sufficient to just use
Ruby's built in class CGI

Kind regards

robert

···

On Wed, Aug 31, 2011 at 7:52 PM, sunny parker <info@2020proj.com> wrote:

i am coming from php and dont seem to quite understand how ruby works
with the browser. how does one implement ruby code into html code?

On Thu, Sep 1, 2011 at 2:56 AM, Buddy Lindsey, Jr. <percent20@gmail.com> wrote:

You will need a framework like rails or sinatra to do web "stuff".

--
remember.guy do |as, often| as.you_can - without end
http://blog.rubybestpractices.com/

A more general solution is:

#!/usr/bin/env ruby

···

On Sep 1, 2011, at 4:37 PM, sunny parker wrote:

had issues with this:

#!/usr/bin/ruby
puts "content-type: text/html\n\n"
puts "Hello World!"

fixed it with this:

#!/xampp-1.74/Ruby192/bin/ruby
puts "content-type: text/html\n\n"
puts "Hello World!"

--
Posted via http://www.ruby-forum.com/\.

Robert Klemme wrote in post #1019588:

···

On Wed, Aug 31, 2011 at 7:52 PM, sunny parker <info@2020proj.com> wrote:

i am coming from php and dont seem to quite understand how ruby works
with the browser. how does one implement ruby code into html code?

On Thu, Sep 1, 2011 at 2:56 AM, Buddy Lindsey, Jr. <percent20@gmail.com> > wrote:

You will need a framework like rails or sinatra to do web "stuff".

Not necessarily. For simple tasks it might be sufficient to just use
Ruby's built in class CGI

Kind regards

robert

but then how would i output using a browser?

--
Posted via http://www.ruby-forum.com/\.

You need a web server capable of using CGI interface. Any web server
should be able to do it these days.

Kind regards

robert

···

On Thu, Sep 1, 2011 at 4:52 PM, sunny parker <info@2020proj.com> wrote:

Robert Klemme wrote in post #1019588:

On Wed, Aug 31, 2011 at 7:52 PM, sunny parker <info@2020proj.com> wrote:

i am coming from php and dont seem to quite understand how ruby works
with the browser. how does one implement ruby code into html code?

On Thu, Sep 1, 2011 at 2:56 AM, Buddy Lindsey, Jr. <percent20@gmail.com> >> wrote:

You will need a framework like rails or sinatra to do web "stuff".

Not necessarily. For simple tasks it might be sufficient to just use
Ruby's built in class CGI

but then how would i output using a browser?

--
remember.guy do |as, often| as.you_can - without end
http://blog.rubybestpractices.com/