Limit "each" list in Rails -
we have this:
<% @shops.each |shop| %> <li><%= shop.name %></li> <% end %> the code yield total result of 50 entries (in case).
how can limit view 20? yeah, limit it, don't want pagination or what.
thanks.
change code in controller @shops being set, or change above code @shops.take(20).each.
Comments
Post a Comment