Go Back   Dedicated Server Hosting | VPS Hosting | Virtual Private Servers Forum > Support > Linux Server Hosting
 

Reply
 
Thread Tools Display Modes
  #1 (permalink)  
Old 06-24-09, 20:59
BOD Member
 
Join Date: Jan 2009
Posts: 45
Default what is ERb?

ERb means Embeded Ruby, and it is probably the coolest tools used on Ruby. ERb was written by Seki Masatoshi. Its major use is to put Ruby code inside an HTML file. ERb reads from word to word. At some point when it reads the Ruby code embedded in the document it sees that it has to fill in a blank.
Reply With Quote
  #2 (permalink)  
Old 06-25-09, 13:58
BOD Member
 
Join Date: Mar 2009
Posts: 229
Default

Thank you for sharing that information. I would like to add few points about ERB.
Embedded Ruby or ERB or eRuby is a templating system. It is similar to ASP, JSP and PHP.

There are several implemetations of eRuby:-
eruby - It is an implementation written in C Programming Language.
erb - It is an implementation purely written in Ruby Programming Language.
erubis - It is an implementation purely written in Ruby as well as in Java. It is fastest of all 3 implementations.
Reply With Quote
  #3 (permalink)  
Old 06-25-09, 18:14
Super Moderator
 
Join Date: Nov 2008
Posts: 752
Smile Installing Eruby in Apache

In order to automatically parse Ruby-embedded which are using Eruby as PHP does, you can setup an Apache web server.

Follow the steps given below so that you can use Eruby with Apache web server :

1. First, in the cgi-bin directory, copy Eruby binary and add the lines given below to httpd.conf:

AddType application/x-httpd-eruby .rhtml
Action application/x-httpd-eruby /cgi-bin/eruby

Note : If you would like to include index.rhtml, you can replace or add DirectoryIndex directive. If you do this, you will be able to create directory listings for directories that do not contain index.html by using Ruby.

2. Now, if you have done the above correctly and if you enter the following directive, even if index.html and index.shtml do not exist in the directory, the embedded Ruby script index.rhtml would be searched.

DirectoryIndex index.html index.shtml index.rhtml

Important : You can also use a site wide Ruby script.

DirectoryIndex index.html index.shtml /cgi-bin/index.rb

Congratulations!! you are done

After the above steps are followed properly, you will be able to generate forms and dynamic content as you can write HTML documents which contain Embedded Ruby.
Reply With Quote
  #4 (permalink)  
Old 07-19-09, 19:55
BOD Member
 
Join Date: Jul 2009
Posts: 49
Default

I don't know much about Ruby. What sort of applications is it best suited for? When and why would I use an application written in Ruby, rather than a more familiar language (i.e. JSP)?
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off
Forum Jump


All times are GMT -6. The time now is 06:32.

Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.2.0
Copyright © 1999-2008, BODHost.com. All rights reserved.