Creating View File for list Method - Ruby on Rails


SUBMITTED BY: inzi

DATE: April 3, 2017, 11:34 a.m.

FORMAT: Ruby

SIZE: 408 Bytes

HITS: 498

  1. Creating View File for list Method - Ruby on Rails
  2. <% if @books.blank? %>
  3. <p>There are not any books currently in the system.</p>
  4. <% else %>
  5. <p>These are the current books in our system</p>
  6. <ul id = "books">
  7. <% @books.each do |c| %>
  8. <li><%= link_to c.title, {:action => 'show', :id => c.id} -%></li>
  9. <% end %>
  10. </ul>
  11. <% end %>
  12. <p><%= link_to "Add new Book", {:action => 'new' }%></p>

comments powered by Disqus