I have a user's list
, when click on 'show activities' this shows a list of user activities in a modal from partial file _user_activities.html.haml
. This activities list is a paginated view. I want to add pagination only for this activities alone inside my modal window. How to do this? I am already using will_paginate
, that makes my page to reload. How to achieve this?
users/index.html.haml
%table
%thead
%th Name
%th Actions
%tbody
- @users.each do |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 do |activity|
%tr
%td= activity.name
%td= activity.type
= will_paginate user.activities