Forum: Ruby on Rails another simple question: per_page in pagination

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
5d15c6821f3c3054c04b85471824ba7c?d=identicon&s=25 xiheng xu (Guest)
on 2006-02-13 18:33
(Received via mailing list)
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 -
5d15c6821f3c3054c04b85471824ba7c?d=identicon&s=25 xiheng xu (Guest)
on 2006-02-14 00:34
(Received via mailing list)
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:
>  ...
>c:/ruby/lib/ruby/gems/1.8/gems/actionpack-1.11.2/lib/action_controller/
>
>http://lists.rubyonrails.org/mailman/listinfo/rails
- RoR newbie -
This topic is locked and can not be replied to.