Thursday, August 04, 2016

rails div_for


<%= div_for(@article, class: "frontpage") do %>
  <td><%= @article.title %></td>
<% end %>


<div id="article_1234" class="article frontpage">
  <td>Hello World!</td>

This has been deprecated. It is also not a good practice to use the div_for tag. Why? Checkout the: Beautiful Markup Rails Conf Presentation slides. If you really need it, it is now part of the record_tag_helper gem.

No comments:

Post a Comment