ruby on rails - How to add an anchor at the end of paginate url in will_paginate -
this question has answer here:
- how paginate combined anchor id 1 answer
hello have problem while using will paginate
gem.i want pagination opened under anchor tab "volunteers".
the link pagination generates "/project_name?page=2"
want include anchor tab in link.like link should "/project_name?page=2#volunteers"
. how can link every time user clicks on next page?
in projects_controller.rb
def show @volunteers=@volunteers.paginate(:page => params[:page], :per_page => 3 ) end
in show.html.slim
=will_paginate @volunteers
i got solution can add anchor links page redirects desired tab.in view replace will_paginate @volunteers will_paginate @volunteers,:container => false,:params => {:anchor => "volunteers"}
this generate new url '/projects?page=2#volunteers'.
Comments
Post a Comment