I have this problem: user can select some params from a form: <% form_tag({:action => "view"}, :method => "get", :target => "_blank") do %> .... <% end %> In method view of controller: ..... @items = Item.paginate :all, :include => ...., :conditions => ....., :page => page, :order => ......, :per_page => 10 ..... In html view: ..... <%= will_paginate @items %> Work very good if user select only one param (form send to controller only one param), but if he select more params the result is ok only for first page. Next pages lose all params except one (selected by user and visible in query string). Can you help me? Thank you --~--~---------~--~----~------------~-------~--~----~ 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 rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
On Mar 16, 2009, at 9:43 AM, engamocap wrote:> > I have this problem: user can select some params from a form: > > <% form_tag({:action => "view"}, :method => "get", :target => > "_blank") do %> > .... > <% end %> > > In method view of controller: > > ..... > @items = Item.paginate :all, :include => ...., :conditions > => ....., :page => page, :order => ......, :per_page => 10 > ..... > > In html view: > > ..... > <%= will_paginate @items %> > > Work very good if user select only one param (form send to controller > only one param), but if he select more params the result is ok only > for first page. Next pages lose all params except one (selected by > user and visible in query string). Can you help me? > > Thank youLook at the docs for will_paginate and check out the :params option. -Rob Rob Biedenharn http://agileconsultingllc.com Rob-xa9cJyRlE0mWcWVYNo9pwxS2lgjeYSpx@public.gmane.org --~--~---------~--~----~------------~-------~--~----~ 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 rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
check what parameters are being sent in the first request and compare with the links that will_paginate is generating. -- 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 rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
I tried use this but don''t work: <%= will_paginate @items, :params => params %> I also tried write this: <%= will_paginate @items, :params => {:params => {''PARAM1'' => params [:PARAM1], ''PARAM2'' => params [:PARAM2], ''PARAM3'' => params [:PARAM3]} %> but ... don''t work. The unique that works is this: <%= will_paginate @items, :params => {:params => {''PARAM1'' => params [:PARAM1]} %> Why? I don''t understand On Mar 16, 3:06 pm, Rob Biedenharn <R...-xa9cJyRlE0mWcWVYNo9pwxS2lgjeYSpx@public.gmane.org> wrote:> On Mar 16, 2009, at 9:43 AM, engamocap wrote: > > > > > > > I have this problem: user can select some params from a form: > > > <% form_tag({:action => "view"}, :method => "get", :target => > > "_blank") do %> > > .... > > <% end %> > > > In method view of controller: > > > ..... > > @items = Item.paginate :all, :include => ...., :conditions > > => ....., :page => page, :order => ......, :per_page => 10 > > ..... > > > In html view: > > > ..... > > <%= will_paginate @items %> > > > Work very good if user select only one param (form send to controller > > only one param), but if he select more params the result is ok only > > for first page. Next pages lose all params except one (selected by > > user and visible in query string). Can you help me? > > > Thank you > > Look at the docs for will_paginate and check out the :params option. > > -Rob > > Rob Biedenharn http://agileconsultingllc.com > R...-xa9cJyRlE0mWcWVYNo9pwxS2lgjeYSpx@public.gmane.org--~--~---------~--~----~------------~-------~--~----~ 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 rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---