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 -