Ruby like Php

Hi, I am studying Ruby for web development and I was guessing if there
is a way to use Ruby, embedded into the html code like one can do with
Php.
I know that this could not be such a popular topic here, but I think it
would be really great to use it "on the fly" in web pages.
I knew that mod_ruby is practically abandoned, could Phusion Passenger
be a solution?

···

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

Giuseppe Caruso wrote:

Hi, I am studying Ruby for web development and I was guessing if there
is a way to use Ruby, embedded into the html code like one can do with
Php.
I know that this could not be such a popular topic here, but I think it
would be really great to use it "on the fly" in web pages.
I knew that mod_ruby is practically abandoned, could Phusion Passenger
be a solution?

You may want to look at ERb (embedded Ruby) or at frameworks like Rails
(which uses ERb).

In both ways you'll end up writing html pages with Ruby code embedded
between <% %> pairs.

Paolo

···

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

Phusion Passenger works much like PHP in that you can just point Apache at
any Rack-based application and Passenger will automagically make it work
just like PHP.

···

On Fri, Jun 19, 2009 at 1:54 PM, Giuseppe Caruso <giuseppe@bonsai-studio.net > wrote:

Hi, I am studying Ruby for web development and I was guessing if there
is a way to use Ruby, embedded into the html code like one can do with
Php.
I know that this could not be such a popular topic here, but I think it
would be really great to use it "on the fly" in web pages.
I knew that mod_ruby is practically abandoned, could Phusion Passenger
be a solution?

--
Tony Arcieri
medioh.com

Tony Arcieri wrote:

Phusion Passenger works much like PHP in that you can just point Apache
at
any Rack-based application and Passenger will automagically make it work
just like PHP.

Tony, please, edit the post to delete my email address… :stuck_out_tongue:

I mean, is there a way to use Ruby like I can do on every webhosting
service out there?
i.e. why I can't just write:

<p>What time is it? it is <%= Time.now %></p>

like I can do with Php?

···

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

Giuseppe Caruso wrote:

Tony Arcieri wrote:
  

Phusion Passenger works much like PHP in that you can just point Apache at
any Rack-based application and Passenger will automagically make it work
just like PHP.
    
Tony, please, edit the post to delete my email address… :stuck_out_tongue:

I mean, is there a way to use Ruby like I can do on every webhosting service out there?
i.e. why I can't just write:

<p>What time is it? it is <%= Time.now %></p>

like I can do with Php?
  
You can do that because they have mod_php set up for you. If your hosting service does not have mod_ruby, but you have shell access, you may be able to (as I have) set up eruby to be used for .rhtml files through your .htaccess file.

-Justin

You only can on php if mod_php is installed.... But you could use fastcgi to invoke erb, assuming, of course, that ruby were installed on the hosting service.

Matt

···

On Sat, 20 Jun 2009, Giuseppe Caruso wrote:

Tony Arcieri wrote:

Phusion Passenger works much like PHP in that you can just point Apache
at
any Rack-based application and Passenger will automagically make it work
just like PHP.

Tony, please, edit the post to delete my email address… :stuck_out_tongue:

I mean, is there a way to use Ruby like I can do on every webhosting
service out there?
i.e. why I can't just write:

<p>What time is it? it is <%= Time.now %></p>

Justin Collins wrote:

Giuseppe Caruso wrote:

I mean, is there a way to use Ruby like I can do on every webhosting
service out there?
i.e. why I can't just write:

<p>What time is it? it is <%= Time.now %></p>

like I can do with Php?
  
You can do that because they have mod_php set up for you. If your
hosting service does not have mod_ruby, but you have shell access, you
may be able to (as I have) set up eruby to be used for .rhtml files
through your .htaccess file.

-Justin

Justin, thanks.
Can you provide me a link to a tutorial/documentation to install it?
Can I also install Haml?

···

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

Giuseppe Caruso wrote:

Justin Collins wrote:
  

Giuseppe Caruso wrote:
    

I mean, is there a way to use Ruby like I can do on every webhosting service out there?
i.e. why I can't just write:

<p>What time is it? it is <%= Time.now %></p>

like I can do with Php?
  

You can do that because they have mod_php set up for you. If your
hosting service does not have mod_ruby, but you have shell access, you
may be able to (as I have) set up eruby to be used for .rhtml files
through your .htaccess file.

-Justin
    
Justin, thanks.
Can you provide me a link to a tutorial/documentation to install it?
Can I also install Haml?
  
About halfway down this page should do it: http://www.hiveminds.co.uk/node/3094

Don't know about Haml. You will need to have its libraries installed where eruby can find them, I guess.

-Justin