Ruby eruby: Difference between revisions

From wikinotes
No edit summary
Line 1: Line 1:
A templating engine built using ruby. Commonly used within [[ruby rails]] .
A templating engine builtin to ruby. Commonly used within [[ruby rails]] .


File extension is <code>.erb</code>.
File extension is <code>.erb</code>.

Revision as of 02:03, 13 May 2022

A templating engine builtin to ruby. Commonly used within ruby rails .

File extension is .erb.

Documentation

homepage http://www.modruby.net/
text helpers (ex: simple_formT) https://api.rubyonrails.org/classes/ActionView/Helpers/TextHelper.html

Tags

<!-- comment -->
<%# comment %>

<!-- NOTE: no comments can escape eruby end '%>' -->
<!-- variable value -->
<%= value %>
<!-- statements -->
<% 5.times do %>
  <p>hello.</p>
<% end %>

Rails Helpers

link_to('homepage', 'https://example.com')