ruby on rails - How to add pagination inside a bootstrap modal -
i have user's list
, when click on 'show activities' shows list of user activities in modal partial file _user_activities.html.haml
. activities list paginated view. want add pagination activities alone inside modal window. how this? using will_paginate
, makes page reload. how achieve this?
users/index.html.haml
%table %thead %th name %th actions %tbody - @users.each |user| %tr %td= user.name %td %i.icon-play %div.modal.hide = render 'user_activities', user: user = will_paginate users :javascript $('i').click(function() { $(this).next(.modal).modal('show'); });
users/_user_activities.html.haml
%table %thead %th name %td type %tbody - user.activities.eadch |activity| %tr %td= activity.name %td= activity.type = will_paginate user.activities
one way achieve ajax type pagination kaminary gem. can set pagination kaminary. don't know how achieve ajax type pagination will_paginate
, used kaminary
in 1 of project , quite easy this.
update
check how implement ajax pagination will_paginate gem providing ajax type pagination will_paginate
.
Comments
Post a Comment