classic_pagination error in rails-2.2

40 views
Skip to first unread message

Thani Ararsu

unread,
Nov 18, 2008, 8:09:35 AM11/18/08
to rubyonra...@googlegroups.com
uninitialized constant ActionController::Pagination::Inflector

C:/ruby/lib/ruby/gems/1.8/gems/activesupport-2.2.0/lib/active_support/dependencies.rb:428:in
`load_missing_constant'
C:/ruby/lib/ruby/gems/1.8/gems/activesupport-2.2.0/lib/active_support/dependencies.rb:77:in
`const_missing'
vendor/plugins/classic_pagination/lib/pagination.rb:100:in
`validate_options!'
vendor/plugins/classic_pagination/lib/pagination.rb:132:in `paginate'
app/controllers/info_controller.rb:117:in `photo'
-e:2:in `load'
-e:2
--
Posted via http://www.ruby-forum.com/.

Frederick Cheung

unread,
Nov 18, 2008, 8:45:57 AM11/18/08
to rubyonra...@googlegroups.com
The Inflector is now ActiveSupport::Inflector. A reminder, if you
needed one, that classic pagination is unmaintained.

Fred

Luke Pearce

unread,
Nov 19, 2008, 5:50:12 AM11/19/08
to rubyonra...@googlegroups.com
You need to change two lines in the pagination.rb file.

From this:

options[:singular_name] ||= Inflector.singularize(collection_id.to_s)
options[:class_name] ||= Inflector.camelize(options[:singular_name])

To this:

options[:singular_name] ||=
ActiveSupport::Inflector.singularize(collection_id.to_s)
options[:class_name] ||=
ActiveSupport::Inflector.camelize(options[:singular_name])

Hasham

unread,
Nov 24, 2008, 5:42:36 AM11/24/08
to Ruby on Rails: Talk
Or install updated plug from git://github.com/hasham2/classic_pagination.git

or by running

script/plugin install git://github.com/hasham2/classic_pagination.git

On Nov 19, 3:50 pm, Luke Pearce <rails-mailing-l...@andreas-s.net>
wrote:

cole...@gmail.com

unread,
Nov 30, 2008, 12:59:37 PM11/30/08
to Ruby on Rails: Talk
Thanks everyone for the help. I got classic pagination installed, as
well as scaffolding. Still getting errors.
NameError in EventsController#index

undefined local variable or method `add_instance_variables_to_assigns'
for #<EventsController:0xb777ef2c>

Any ideas? Should I just throw away (or burn) this book and buy
something newer? Thanks

Conrad Taylor

unread,
Nov 30, 2008, 3:10:06 PM11/30/08
to rubyonra...@googlegroups.com
On Sun, Nov 30, 2008 at 9:59 AM, cole...@gmail.com <cole...@gmail.com> wrote:

Thanks everyone for the help.  I got classic pagination installed, as
well as scaffolding.  Still getting errors.
 NameError in EventsController#index

undefined local variable or method `add_instance_variables_to_assigns'
for #<EventsController:0xb777ef2c>

Any ideas?  Should I just throw away (or burn) this book and buy
something newer?  Thanks

Hi, this really depends on the version of Rails installed versus the version of Rails the 
book uses.  I would recommend the PDF for "Agile Web Development with Rails 3rd":


Good luck,

-Conrad

Reply all
Reply to author
Forward
0 new messages