F
fire3000
hello,
I have an paginate problem in the controller.
Note: I user the "Mytest::Account".
I can live with this, but any help is greatly appreciated.
code:
class Mytest::Account < ActiveRecord::Base
end
class Mytest::AccountController < ApplicationController
def index
list
render :action => 'list'
end
def list
@account_pages, @accounts = paginate :accounts, er_page => 10
end
end
error:
NameError in Mytest/accountController#list
uninitialized constant Account
RAILS_ROOT: ./script/../config/..
Application Trace | Framework Trace | Full Trace
D:/tools/ruby/lib/ruby/gems/1.8/gems/activesupport-1.3.1/lib/active_support/dependencies.rb:100:in
`const_missing'
D:/tools/ruby/lib/ruby/gems/1.8/gems/activesupport-1.3.1/lib/active_support/dependencies.rb:131:in
`const_missing'
D:/tools/ruby/lib/ruby/gems/1.8/gems/activesupport-1.3.1/lib/active_support/inflector.rb:161:in
`constantize'
D:/tools/ruby/lib/ruby/gems/1.8/gems/activesupport-1.3.1/lib/active_support/core_ext/string/inflections.rb:59:in
`constantize'
D:/tools/ruby/lib/ruby/gems/1.8/gems/actionpack-1.12.1/lib/action_controller/pagination.rb:194:in
`paginator_and_collection_for'
D:/tools/ruby/lib/ruby/gems/1.8/gems/actionpack-1.12.1/lib/action_controller/pagination.rb:129:in
`paginate'
#{RAILS_ROOT}/app/controllers/mytest/account_controller.rb:13:in `list'
-e:4
I have an paginate problem in the controller.
Note: I user the "Mytest::Account".
I can live with this, but any help is greatly appreciated.
code:
class Mytest::Account < ActiveRecord::Base
end
class Mytest::AccountController < ApplicationController
def index
list
render :action => 'list'
end
def list
@account_pages, @accounts = paginate :accounts, er_page => 10
end
end
error:
NameError in Mytest/accountController#list
uninitialized constant Account
RAILS_ROOT: ./script/../config/..
Application Trace | Framework Trace | Full Trace
D:/tools/ruby/lib/ruby/gems/1.8/gems/activesupport-1.3.1/lib/active_support/dependencies.rb:100:in
`const_missing'
D:/tools/ruby/lib/ruby/gems/1.8/gems/activesupport-1.3.1/lib/active_support/dependencies.rb:131:in
`const_missing'
D:/tools/ruby/lib/ruby/gems/1.8/gems/activesupport-1.3.1/lib/active_support/inflector.rb:161:in
`constantize'
D:/tools/ruby/lib/ruby/gems/1.8/gems/activesupport-1.3.1/lib/active_support/core_ext/string/inflections.rb:59:in
`constantize'
D:/tools/ruby/lib/ruby/gems/1.8/gems/actionpack-1.12.1/lib/action_controller/pagination.rb:194:in
`paginator_and_collection_for'
D:/tools/ruby/lib/ruby/gems/1.8/gems/actionpack-1.12.1/lib/action_controller/pagination.rb:129:in
`paginate'
#{RAILS_ROOT}/app/controllers/mytest/account_controller.rb:13:in `list'
-e:4