Okay! I got the pagination links to work. Now I need them to display in
the same div where the first results go, without reloading a page and
discarding my layout.
I had to:
ROUTES.RB
map.resources :dictated_exams, :collection => {:filter_widget => :get}
_list.erb:
<%= will_paginate dictated_exams, :params => {:date => date} %>
index.html.erb, the observe_field:
:url => {:action => 'filter_widget', :controller => 'dictated_exams',
:method => :post },
dictated_exams_controller.rb:
def filter_widget
@date ||= params[:date].to_date
end_date = @date + 1.days
dictated_exams = DictatedExam.search_one_day(@date, params[:page])
render :partial => 'dictated_exams/list' , :locals =>
{ :dictated_exams => dictated_exams, :date => @date }
end
Now to get the results to display where I want them to display...
--
Posted via http://www.ruby-forum.com/.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Ruby
on Rails: Talk" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---