Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is the Rails way to split a view into separate pages?

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?

like image 600
kale Avatar asked Nov 04 '22 07:11

kale


1 Answers

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.

like image 88
wpp Avatar answered Nov 15 '22 05:11

wpp