After creating new entries this code works:
<%= book.title, :class=>"test" %>
But when database empty its throws error is there any way to display if its empty don't show else show?
similar like this:
<% if ... empty
<p>no record found</p>
<% else %>
<%= book.title, :class=>"test" %>
<% end %>
thanks!
.try(:method). exemple:<%= book.try(:title) || 'no book found', :class=>"test" %>