Rails will_paginate custom route

前端 未结 3 1738
庸人自扰
庸人自扰 2020-12-31 20:32

How can I use will_paginate with a custom route?

I have the following in my routes:

map.connect \'human-readable/:name\', :controller => :tags, :a         


        
3条回答
  •  庸人自扰
    2020-12-31 21:21

    Another option is to use param in will_paginate but passing in the parameter like so:

    <%= will_paginate @products, :params => {:controller => 'human-readable', :action => 'show', :name => 'xyz'} %>
    

    and now your links will look like human-readable/xyz?page=2...

提交回复
热议问题