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

Popular posts from this blog

php - What is the difference between $_SERVER['PATH_INFO'] and $_SERVER['ORIG_PATH_INFO']? -

fortran - Function return type mismatch -

queue - mq_receive: message too long -