Hi all,
I have a table called lenses for which i created the following inflection rule in environment.rb to support pluralization of lens.
Inflector.inflections do |inflect| inflect.plural(/(lens)$/i, '\1es') end
Next I generated a scaffold for it
ruby script\generate scaffold admin::lens
But when I access the list view in browser I am getting the following error
NameError in Admin/lensesController#index
uninitialized constant Lense
RAILS_ROOT: ./script/../config/.. c:/ruby/lib/ruby/gems/1.8/gems/activesupport-1.4.2/lib/active_support/dependencies.rb:266:in `load_missing_constant' c:/ruby/lib/ruby/gems/1.8/gems/activesupport-1.4.2/lib/active_support/dependencies.rb:452:in `const_missing' c:/ruby/lib/ruby/gems/1.8/gems/activesupport-1.4.2/lib/active_support/dependencies.rb:464:in `const_missing' c:/ruby/lib/ruby/gems/1.8/gems/activesupport-1.4.2/lib/active_support/inflector.rb:250:in `constantize' c:/ruby/lib/ruby/gems/1.8/gems/activesupport-1.4.2/lib/active_support/core_ext/string/inflections.rb:148:in `constantize' c:/ruby/lib/ruby/gems/1.8/gems/actionpack-1.13.3/lib/action_controller/pagination.rb:195:in `paginator_and_collection_for' c:/ruby/lib/ruby/gems/1.8/gems/actionpack-1.13.3/lib/action_controller/pagination.rb:130:in `paginate' #{RAILS_ROOT}/app/controllers/admin/lenses_controller.rb:12:in `list' #{RAILS_ROOT}/app/controllers/admin/lenses_controller.rb:3:in `index'
Can someone suggest a fix for this? What am I doing wrong?
Regards, Abhi