Replace HTML code in Views

suggest change

content_for captures a block in a view. yield prints it from the layout. Put yield in the layout. If both are in the same template, call content_for before yield, or the yield runs while the block is still empty.

Layout

<div>
  <%= yield :header %>
</div>

View

<% content_for :header do %>
  <ul>
    <li>Line Item 1</li>
    <li>Line Item 2</li>
  </ul>
<% end %>

Feedback about page:

Feedback:
Optional: your email if you want me to get back to you:



Table Of Contents