paginate?

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, :per_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
 
Z

zycte

module Mytest
class Account < ActiveRecord::Base
end

class AccountController < ApplicationController
def index
...
end
def list
@account_pages, @accounts = paginate :accounts, :per_page => 10
end
end

end
 
F

fire3000

Thank everybody.
My problem has been resolved.
@account_pages, @accounts = paginate :accounts, :per_page => 10
@account_pages, @accounts = paginate 'mytest/accounts', :per_page
=> 10
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,767
Messages
2,569,572
Members
45,046
Latest member
Gavizuho

Latest Threads

Top