Reputation: 1261
Within my show action/view I'm displaying a lot of data that I want to split-up into separate pages (in this case three pages total). I can do this easily by adding a new action and view for each additional page, but is that the "correct" way to do it in Rails?
Upvotes: 5
Views: 1025
Reputation: 2752
Are you looking for a pagination solution? If so, I would suggest either kaminari or will_paginate. Also, they each have railscast if you need any help getting set up.
Upvotes: 0
Reputation: 7313
Great question!
I can do this easily by adding a new action and view for each additional page, but is that the "correct" way to do it in Rails?
I suspect you are unsure about violating REST?
I don't know what data you are displaying, but In the end the clearest and simplest solution for you (code wise) and your users (design wise) should win, if that means adding a new action, so be it. Avoid adding a new controller just for the sake of a new show action.
Upvotes: 2