Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Ruby > paginate?

Reply
Thread Tools

paginate?

 
 
fire3000@hzcnc.com
Guest
Posts: n/a
 
      06-14-2006
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

 
Reply With Quote
 
 
 
 
zycte
Guest
Posts: n/a
 
      06-14-2006
module Mytest
class Account < ActiveRecord::Base
end

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

end

On 2006-06-14 10:46:48 +0200, http://www.velocityreviews.com/forums/(E-Mail Removed) said:

> 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



 
Reply With Quote
 
 
 
 
fire3000@hzcnc.com
Guest
Posts: n/a
 
      06-15-2006

who can helpe me!!!

Someone have same the problem!!!

 
Reply With Quote
 
fire3000@hzcnc.com
Guest
Posts: n/a
 
      06-16-2006
Thank everybody.
My problem has been resolved.
> @account_pages, @accounts = paginate :accounts, er_page => 10

@account_pages, @accounts = paginate 'mytest/accounts', er_page
=> 10

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off




Advertisments