Eruby

From Wikipedia, the free encyclopedia

For type of implementation of embedded Ruby into HTML, see eRuby.
The correct title of this article is eruby. The initial letter is shown capitalized due to technical restrictions.

eruby is an implementation of eRuby, embedding Ruby programming language into HTML document. An eRuby file ends with .rhtml file extension.

[edit] Scripting element

Ruby codes are embedded with in a pair of <% and %> delimiters.

There are only three type of script element in eruby:

  1. <% ruby code %> - Output like hello from print "hello" would replace the ruby code between the delimiters.
  2. <%= ruby expression %> - Value evaluated from expression like 11 from 7 + 4 would replace the ruby expression between the delimiters.
  3. <%# ruby code %> - ruby code is ignored and generates nothing.

[edit] See also

[edit] External links