[Ruby] How to Use will_paginate with Nested Resources

Tadashi Shigeoka ·  Sun, February 24, 2013

Here’s a memo on how to use the gem “will_paginate” which provides pagination functionality with nested resources.

As shown below, you can specify the routing in params with a hash.

will_paginate @tasks,
  params: { controller: 'tasks', action: 'index', project_id: @project.id }

That’s all from the Gemba.