I try to play with Kaminari stone for pagination, but I have problems.
I have a simple start-up project with a simple model:
class Position < ActiveRecord::Base validates_presence_of :name end
I am working with ruby ββ1.9.2 and rails 3.0.5 on Ubuntu 10.04. I installed kaminari (0.10.4).
From what I understand, I would have to execute Position.order ("name"). page (1), but when I do this, I get the following:
ruby-1.9.2-p0 > Position.order("name").page(1) NoMethodError: undefined method `page' for #<ActiveRecord::Relation:0xaacab34> from /home/bob/.rvm/gems/ ruby-1.9.2-p0@talentskout /gems/activerecord-3.0.5/lib/active_record/relation.rb:371:in `method_missing' from (irb):2 from /home/bob/.rvm/gems/ ruby-1.9.2-p0@talentskout /gems/railties-3.0.5/lib/rails/commands/console.rb:44:in `start' from /home/bob/.rvm/gems/ ruby-1.9.2-p0@talentskout /gems/railties-3.0.5/lib/rails/commands/console.rb:8:in `start' from /home/bob/.rvm/gems/ ruby-1.9.2-p0@talentskout /gems/railties-3.0.5/lib/rails/commands.rb:23:in `<top (required)>' from script/rails:6:in `require' from script/rails:6:in `<main>'
This seems like a simple script that I can get. Any ideas would be greatly appreciated.
Thanks.
source share