paginate?

Discussion in 'Ruby' started by fire3000@hzcnc.com, Jun 14, 2006.

  1. Guest

    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
     
    , Jun 14, 2006
    #1
    1. Advertising

  2. zycte Guest

    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

    On 2006-06-14 10:46:48 +0200, 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, :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
     
    zycte, Jun 14, 2006
    #2
    1. Advertising

  3. Guest

    who can helpe me!!!

    Someone have same the problem!!!
     
    , Jun 15, 2006
    #3
  4. Guest

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

    @account_pages, @accounts = paginate 'mytest/accounts', :per_page
    => 10
     
    , Jun 16, 2006
    #4
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. VB Programmer
    Replies:
    1
    Views:
    1,262
    S. Justin Gengo [MCP]
    Jan 27, 2006
  2. Replies:
    1
    Views:
    526
    Gregory A. Beamer
    Dec 22, 2009
  3. Peter Litsegard

    Paginate doesn't work AT ALL!!!

    Peter Litsegard, Apr 6, 2005, in forum: ASP .Net Mobile
    Replies:
    0
    Views:
    118
    Peter Litsegard
    Apr 6, 2005
  4. Peter Litsegard

    Paginate - help please!!!

    Peter Litsegard, Apr 8, 2005, in forum: ASP .Net Mobile
    Replies:
    0
    Views:
    135
    Peter Litsegard
    Apr 8, 2005
  5. Samatha Jupally

    Paginate

    Samatha Jupally, Dec 22, 2008, in forum: Ruby
    Replies:
    4
    Views:
    102
    Damjan Rems
    Dec 22, 2008
Loading...

Share This Page