So I want to display a result set on a page. But I only want 10 results on the page along with a link to the next set of 10 in the results. Is there a component for this in Rails? If not, how do people approach this problem in Rails? Thanks, Jamie
Dang if I didn''t find, read about, download and implement PaginationHelper between the time I posted and the time I read your reply. That helper rocks! Jamie On Jan 12, 2005, at 1:02 AM, Demetrius Nunes wrote:> Take a look at this excelent helper by Sam Stephenson > <http://wiki.rubyonrails.com/rails/show/SamStephenson>: > http://wiki.rubyonrails.com/rails/show/PaginationHelper > > Jamie Orchard-Hays wrote: > >> So I want to display a result set on a page. But I only want 10 >> results on the page along with a link to the next set of 10 in the >> results. Is there a component for this in Rails? If not, how do >> people approach this problem in Rails? >> >> Thanks, >> >> Jamie >> >> _______________________________________________ >> Rails mailing list >> Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org >> http://lists.rubyonrails.org/mailman/listinfo/rails >> >> > > _______________________________________________ > Rails mailing list > Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org > http://lists.rubyonrails.org/mailman/listinfo/rails >
Take a look at this excelent helper by Sam Stephenson <http://wiki.rubyonrails.com/rails/show/SamStephenson>: http://wiki.rubyonrails.com/rails/show/PaginationHelper Jamie Orchard-Hays wrote:> So I want to display a result set on a page. But I only want 10 > results on the page along with a link to the next set of 10 in the > results. Is there a component for this in Rails? If not, how do people > approach this problem in Rails? > > Thanks, > > Jamie > > _______________________________________________ > Rails mailing list > Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org > http://lists.rubyonrails.org/mailman/listinfo/rails > >
Stefan Kaes
2005-Jan-12 06:20 UTC
help wanted: problem with setting up rails to use activereocord as session store (rails 0.9.3)
I have tried to use ActiveRecord as session storage mechanism by following the instructions on http://wiki.rubyonrails.com/rails/show/HowtoChangeSessionOptions Specifically I added the line ActionController::CgiRequest::DEFAULT_SESSION_OPTIONS.update(:database_manager => CGI::Session::ActiveRecordStore) to environments/development.rb. On the first visit to a page, a session entry is added to the database, but when I try to accesss the session with the following code @session[''user''] = User.find_first("name=''gast''") unless @session[''user'']) I get an error: (works perfectly with pstore) IndexError in Rezept#index string not matched /app/controllers/rezept_controller.rb:282:in `auth_action'' Show framework trace F:/ruby/lib/ruby/1.8/cgi/session/pstore.rb:25:in `[]='' F:/ruby/lib/ruby/1.8/cgi/session/pstore.rb:25:in `[]='' /vendor/actionpack/lib/action_controller/filters.rb:256:in `send'' /vendor/actionpack/lib/action_controller/filters.rb:256:in `call_filters'' /vendor/actionpack/lib/action_controller/filters.rb:254:in `each'' /vendor/actionpack/lib/action_controller/filters.rb:254:in `call_filters'' /vendor/actionpack/lib/action_controller/filters.rb:243:in `before_action'' /vendor/actionpack/lib/action_controller/filters.rb:235:in `perform_action_without_benchmark'' /vendor/actionpack/lib/action_controller/benchmarking.rb:30:in `perform_action_without_rescue'' /vendor/actionpack/lib/action_controller/benchmarking.rb:30:in `measure'' /vendor/actionpack/lib/action_controller/benchmarking.rb:30:in `perform_action_without_rescue'' /vendor/actionpack/lib/action_controller/rescue.rb:75:in `perform_action'' /vendor/actionpack/lib/action_controller/base.rb:263:in `send'' /vendor/actionpack/lib/action_controller/base.rb:263:in `process'' /vendor/actionpack/lib/action_controller/base.rb:241:in `process'' /vendor/railties/lib/dispatcher.rb:39:in `dispatch'' F:/home/kaes/rdev/private/dispatch.fcgi:9 F:/home/kaes/rdev/private/dispatch.fcgi:9:in `each_cgi'' F:/ruby/lib/ruby/site_ruby/1.8/fcgi.rb:597:in `each'' F:/ruby/lib/ruby/site_ruby/1.8/fcgi.rb:597:in `each_cgi'' F:/home/kaes/rdev/private/dispatch.fcgi:9 Request Parameters: None Show session dump --- "--- {}" Response Headers: {"cookie"=>[], "Cache-Control"=>"no-cache"} Show template parameters --- rescues_path: F:/home/kaes/rdev/private/../config/..//vendor/actionpack/lib/action_controller/templates/rescues/ flash: {} So it seems as if some part of rails still thinks it should use pstore instead of the database. Is something wrong with my setup or is this a bug? -- stefan
Scott Barron
2005-Jan-12 13:28 UTC
Re: help wanted: problem with setting up rails to use activereocord as session store (rails 0.9.3)
Stefan Kaes wrote:> I have tried to use ActiveRecord as session storage mechanism by following the instructions on > > http://wiki.rubyonrails.com/rails/show/HowtoChangeSessionOptions >Stefan, Please see http://dev.rubyonrails.org/ticket/430 There is something funky going on with ActiveRecordStore when using the development and test environments, though it seems to be working in the production environment. My guess is that it has something to do with the auto-reloading in the dev/test environments, but I''m not sure just where it''s breaking down. -Scott _______________________________________________ Rails mailing list Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org http://lists.rubyonrails.org/mailman/listinfo/rails
Stefan Kaes
2005-Jan-12 16:46 UTC
AW: help wanted: problem with setting up rails touse activereocord as session store (rails 0.9.3)
Scott, thanks very much, it works in the production environment. Could you please tell me how I can receive a notification when the ticket is closed? Do I need a userid on the Trac system and if so, how can I get one? -- stefan -----Ursprüngliche Nachricht----- Von: rails-bounces-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org [mailto:rails-bounces-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org]Im Auftrag von Scott Barron Gesendet: Mittwoch, 12. Januar 2005 14:28 An: rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org Betreff: Re: [Rails] help wanted: problem with setting up rails touse activereocord as session store (rails 0.9.3) Stefan Kaes wrote:> I have tried to use ActiveRecord as session storage mechanism by following the instructions on > > http://wiki.rubyonrails.com/rails/show/HowtoChangeSessionOptions >Stefan, Please see http://dev.rubyonrails.org/ticket/430 There is something funky going on with ActiveRecordStore when using the development and test environments, though it seems to be working in the production environment. My guess is that it has something to do with the auto-reloading in the dev/test environments, but I''m not sure just where it''s breaking down. -Scott