ruby on rails - Kaminari custom config per page -


i have on kaminari config:

kaminari.configure |config|   config.default_per_page = 50 end 

and want set custom value per page action:

@my_models = mymodel.all.per(20) 

i set this:

@my_models = mymodel.all.per(kaminari.my_custom_per_page) 

because change test action less objects. possible?

class mymodel < activerecord::base

paginates_per 20

...

end


Comments

Popular posts from this blog

javascript - Jquery show_hide, what to add in order to make the page scroll to the bottom of the hidden field once button is clicked -

javascript - Highcharts multi-color line -

javascript - Enter key does not work in search box -