Beate Paland wrote:>> Are people use hidden form fields, then passing the page number to the
>> show, edit actions?
>
> Why not save the page variable in a session?
>
> Beate
Ended up taking this approach:
In list.rhtml, add a page_number parameter to the show action link:
<%= link_to ''Show'', :action => ''show'',
:id => media, :page_number
=>@media_pages.current %><br/>
In show action on the controller, grab that parameter into a variable so
you can access it from show.rhtml view:
@page_number = params[:page_number]
In show.rhtml view, pass the list action on the controller the page
number:
<%= link_to ''Back'', :action => ''list'',
:page => @page_number %><br />
Seems to work well. I wonder if there is an easier or more elegant way
to do this?
--
Posted via http://www.ruby-forum.com/.