Could anyone help me clarify this? I finally had some code working such
that I can sort by column headings on paginated pages.. But being
unable to specify :per_page in the search box is a bit annoying.
Thanks..
On Monday, February 13, 2006, at 5:33 PM, xiheng xu
wrote:>Hi,
>
>Why can''t I use a variable to specify the :per_page attribute when
using
>the most basic form of pagination? (if I use a hardcode number, it
>runs) What did I do? Thx.
>
>My code:
>
>def list_orders
> page_size = 20
> ...
> order_pages, @orders = paginate(:orders, :per_page => page_size)
>end
>
>My Errors:
>
>undefined method `>'' for false:FalseClass
>
>RAILS_ROOT: ./script/../config/..
>Application Trace | Framework Trace | Full Trace
>
>c:/ruby/lib/ruby/gems/1.8/gems/actionpack-1.11.2/lib/action_controller/
>pagination.rb:210:in `<=''
>c:/ruby/lib/ruby/gems/1.8/gems/actionpack-1.11.2/lib/action_controller/
>pagination.rb:210:in `initialize''
>c:/ruby/lib/ruby/gems/1.8/gems/actionpack-1.11.2/lib/action_controller/
>pagination.rb:191:in `new''
>c:/ruby/lib/ruby/gems/1.8/gems/actionpack-1.11.2/lib/action_controller/
>pagination.rb:191:in `paginator_and_collection_for''
>c:/ruby/lib/ruby/gems/1.8/gems/actionpack-1.11.2/lib/action_controller/
>pagination.rb:124:in `paginate''
>#{RAILS_ROOT}/app/controllers/book_viewer_controller.rb:77:in
`list_orders''
>
>
>
>
>- RoR newbie -
>
>--
>Posted with http://DevLists.com. Sign up and save your time!
>_______________________________________________
>Rails mailing list
>Rails@lists.rubyonrails.org
>http://lists.rubyonrails.org/mailman/listinfo/rails
- RoR newbie -
--
Posted with http://DevLists.com. Sign up and save your time!