Elemental

Call XHTML elements as methods in your ERb templates:

1 <%= p @item.content %>
becomes
1 <p>Your Content</p>

1 <%= span "some content", :id => "54" %>

becomes

1 <span id="54">some content</span>

1 <% ul do ['one', 'two', 'three'].each do |item| %>
2   <%= li item %>
3 <% end end %>
becomes
1 <ul>
2   <li>one</li>
3   <li>two</li>
4   <li>three</li>
5 </ul>

Tags

Currently tagged with: erb, xhtml
You need to Login to tag this item.