In Rails, embedded Ruby in .rhtml pages is run using a processor called ERb, for Embedded Ruby. : ERB « Rails « Ruby






In Rails, embedded Ruby in .rhtml pages is run using a processor called ERb, for Embedded Ruby.


<html>
  <head>
    <title>Using Ruby on Rails</title>
  </head>
  <body>
    <%= 2 + 3 %>
  </body>
</html>



 








firstERB.zip( 87 k)

Related examples in the same category

1.You can mix HTML and ERb as well
2.Mix Ruby Code and HTML
3.use puts to display text in a web page (It was printed out in the console.)
4.A loop executes the body of the loop
5.uses the Ruby Time.now method to display the current time
6.Escaping Sensitive Text