Hi all! First of all I''d like to thank everyone for the Rails framework. It never stops to fanscinate me. But I''ve found a problem and because I''m quite new to Rails I''d like to ask here first before I say I''ve found a bug. I''ve a view with form that contains just one text_field and one select: -------8<-------------8<----------- <p>Search the database for a file:</p> <form action="search_file" method="get"> Filename: <%= text_field ''post'', ''fn'', ''size'' => 20 %> <%= select(''post'', ''ft'', Type.find_all.collect {|p| [ p.description, p.id ] }, {:include_blank => true}) %> <input type="submit" value="Search"> </form> -------8<-------------8<----------- This works well. It creates a hash ''post'' with two items, ''fn'' and ''ft''. They contains correct values. The ''search_file'' action uses pagination to show the results: -------8<-------------8<----------- @result_pages, @result = paginate :full, :conditions => cond, :order_by => ''id,dir,name'', :per_page => 25 -------8<-------------8<----------- The @params still contains the ''post'' hash with the two items. The first page is shown correctly, there are pagination links to the other pages. The @params still contains the ''post'' hash with the two items. I create the pagination links like this: -------8<-------------8<----------- @params.delete(''page'') if @result_pages.page_count > 1 page_links = ''Pages: '' + pagination_links(@result_pages, :params => @params) end -------8<-------------8<----------- Here goes the problem part. The pagination_links to the other pages have the ''post'' hash mangled. On the other pages it is just string with mixed keys with values of the ''post'' hash. The debug of the @params on the first page look like this: -------8<-------------8<----------- !map:HashWithIndifferentAccess post: !map:HashWithIndifferentAccess ft: A fn: a action: search_file -------8<-------------8<----------- The debug of the @params on the other page look like this: -------8<-------------8<----------- !map:HashWithIndifferentAccess post: ftAfna action: search_file -------8<-------------8<----------- This is probably not pagination problem. I''m lost here. Can anyone help? TIA Mody I''m using Debian Unstable with Rails version 0.13.1-2. -- You know, I always thought a failsafe system was supposed to be safe... ... from failure. Jack O''Neill, SG-1, S8E6 _______________________________________________ Rails mailing list Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org http://lists.rubyonrails.org/mailman/listinfo/rails
mody-a4qEbw8STSk@public.gmane.org
2005-Oct-13 07:13 UTC
Re: pagination and @params problem
Anyone on this, please? I''m stuck with this. TIA Mody -- You know, I always thought a failsafe system was supposed to be safe... ... from failure. Jack O''Neill, SG-1, S8E6 _______________________________________________ Rails mailing list Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org http://lists.rubyonrails.org/mailman/listinfo/rails
mody-a4qEbw8STSk@public.gmane.org
2005-Oct-13 13:27 UTC
SOLVED: pagination and @params problem
I''ve just found the problem: I used `text_field` and `select` instead of `text_field_tag` and `select_tag`. They are not connected to any model so I need the *_tag methods. My missunderstanding of the concept. Mody -- You know, I always thought a failsafe system was supposed to be safe... ... from failure. Jack O''Neill, SG-1, S8E6 _______________________________________________ Rails mailing list Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org http://lists.rubyonrails.org/mailman/listinfo/rails
On 10/13/05, mody-a4qEbw8STSk@public.gmane.org <mody-a4qEbw8STSk@public.gmane.org> wrote:> Anyone on this, please? I''m stuck with this. > > TIA > Mody >I am new to rails, so I may be way off. I am wondering if it makes sense to pass params to paginate_links? The api docs indicate this parameter should contain any additional routing parameters for page URLs, this does not appear to be your case. Dave
mody-a4qEbw8STSk@public.gmane.org
2005-Oct-14 08:13 UTC
Re: pagination and @params problem
Hi! On Thu, Oct 13, 2005 at 07:37:25 -0600, David Clements wrote:> I am wondering if it makes sense to pass params to paginate_links? > The api docs indicate this parameter should contain any additional > routing parameters for page URLs, this does not appear to be your > case.In my application I have search and its result. The result is paginated. If I understand the pagination correctly there is no other way to paginate such concept. The result is not a table it''s created everytime the result is wanted. Mody -- You know, I always thought a failsafe system was supposed to be safe... ... from failure. Jack O''Neill, SG-1, S8E6 _______________________________________________ Rails mailing list Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org http://lists.rubyonrails.org/mailman/listinfo/rails