Ruby eruby

From wikinotes
Revision as of 20:49, 19 November 2020 by Will (talk | contribs) (→‎Tags)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

A templating engine built using ruby. Commonly used within ruby rails .

File extension is .erb.

Documentation

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')