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?
Giuseppe C. 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
Tony A. 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…
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:
What time is it? it is <%= Time.now %>
like I can do with Php?
On Fri, Jun 19, 2009 at 1:54 PM, Giuseppe C.
<[email protected]
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?
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 Sat, 20 Jun 2009, Giuseppe C. wrote:
i.e. why I can’t just write:
What time is it? it is <%= Time.now %>
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
Giuseppe C. 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:What time is it? it is <%= Time.now %>
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 C. wrote:
Giuseppe C. 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:What time is it? it is <%= Time.now %>
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?
Giuseppe C. wrote:
like I can do with Php?
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