Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8754537
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T13:38:41+00:00 2026-06-13T13:38:41+00:00

Can you please help me with the following problem? This I know is basic,

  • 0

Can you please help me with the following problem? This I know is basic, but I seem to be missing something very basic. When i ask SectionEdit.new things seem to go wrong though I am pointing to the correct class name. Thanks for your help.

here is the error i get.

$ edit = SectionEdit.new
NameError: undefined local variable or method `class_name' for #<Class:0x103675008>
    from /Library/Ruby/Gems/1.8/gems/activerecord-3.2.8/lib/active_record/dynamic_matchers.rb:50:in `method_missing'
    from /Users/seydoukonate/Sites/simple_cms/app/models/section_edit.rb:3
    from /Library/Ruby/Gems/1.8/gems/activesupport-3.2.8/lib/active_support/dependencies.rb:469:in `load'
    from /Library/Ruby/Gems/1.8/gems/activesupport-3.2.8/lib/active_support/dependencies.rb:469:in `load_file'
    from /Library/Ruby/Gems/1.8/gems/activesupport-3.2.8/lib/active_support/dependencies.rb:639:in `new_constants_in'
    from /Library/Ruby/Gems/1.8/gems/activesupport-3.2.8/lib/active_support/dependencies.rb:468:in `load_file'
    from /Library/Ruby/Gems/1.8/gems/activesupport-3.2.8/lib/active_support/dependencies.rb:353:in `require_or_load'
    from /Library/Ruby/Gems/1.8/gems/activesupport-3.2.8/lib/active_support/dependencies.rb:502:in `load_missing_constant'
    from /Library/Ruby/Gems/1.8/gems/activesupport-3.2.8/lib/active_support/dependencies.rb:192:in `const_missing'
    from /Library/Ruby/Gems/1.8/gems/activesupport-3.2.8/lib/active_support/dependencies.rb:190:in `each'
    from /Library/Ruby/Gems/1.8/gems/activesupport-3.2.8/lib/active_support/dependencies.rb:190:in `const_missing'
    from (irb):14

I have defined my model ‘page’ as below

class SectionEdit < ActiveRecord::Base
  attr_accessible :admin_user_id, :section_id, :summary
  belongs_to :editor, class_name => "AdminUser", :foreign_key => 'admin_user_id'
  belongs_to :section
end

Admin user

class AdminUser < ActiveRecord::Base
   attr_accessible :first_name, :last_name, :email, :username

  has_and_belongs_to_many :pages
  has_many :section_edits

  scope :named, lambda{|first,last| where(:first_name => first,:last_name => last)}
end

Section

class Section < ActiveRecord::Base
  attr_accessible :name, :position, :visible, :content_type, :content
  belongs_to :page
  has_many :section_edits
end
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-13T13:38:43+00:00Added an answer on June 13, 2026 at 1:38 pm

    change class_name to :class_name

    belongs_to :editor, class_name => "AdminUser", :foreign_key => 'admin_user_id'
    

    to

    belongs_to :editor, :class_name => "AdminUser", :foreign_key => 'admin_user_id'
    

    For Rails 3

    belongs_to :editor, class_name: "AdminUser", foreign_key: 'admin_user_id'
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Can anyone please help me to work out how to achieve the following? I
Can someone please help me figure out a way to achieve the following (see
Can anyone please help. I'm following a tutorial found here as I have a
Please can someone help? I have the following code which uploads a file to
I wonder whether someone can help me please. I'm using the following script to
Can anyone help me in the following question please? Define a macro which has
I wonder whether someone can help me please. I have the following xml file
I know that this question have been asked several times. But I can't get
Can anyone please help me out.I have been stuck with this NSMutableArray for last
Somebody please help me out. This problem is killing me. I went through tones

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.