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 1081937
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T22:14:01+00:00 2026-05-16T22:14:01+00:00

This is the error I get: ContactPostalcardsController#skip (NoMethodError) undefined method `status=’ for #<ContactPostalcard:0x2b21433d64b0> This

  • 0

This is the error I get:

ContactPostalcardsController#skip (NoMethodError) "undefined method `status=' for #<ContactPostalcard:0x2b21433d64b0>"

This is the code calling it and trying to assign a value to the status attribute for ContactPostalcard (the Model):

  def skip

    @contact_postalcard = ContactPostalcard.new(params[:contact_postalcard])
    @contact_postalcard.contact_id = params[:contact_id]
    @contact_postalcard.postalcard_id = params[:postalcard_id]

    @contact_postalcard.status = "skipped"
    @contact_postalcard.date_sent = Date.today
    @contact_postalcard.date_created = Date.today

    if @contact_postalcard.save
      render :text => 'This email was skipped!'

    end
  end 

This is the Model referred. Note the “annotate” output shows status as an attribute:

class ContactPostalcard < ActiveRecord::Base
  attr_accessible :title, :contact_id, :postal_id, :postalcard_id, :message, :campaign_id, :date_sent, :status


  belongs_to :contact
  belongs_to :postalcard

  alias_attribute :body, :message
  alias_attribute :subject, :title 

  named_scope :nosugar, :conditions => { :sugarcrm => false }

  def company_name
    contact = Contact.find_by_id(self.contact_id)

    return contact.company_name

  end 

  def asset
    Postalcard.find_by_id(self.postalcard_id)
  end

  def asset_class
    Postalcard.find_by_id(self.postalcard_id).class.name
  end  

end



# == Schema Information
#
# Table name: contact_postalcards
#
#  id            :integer         not null, primary key
#  title         :string(255)
#  contact_id    :integer
#  postalcard_id :integer
#  message       :text
#  campaign_id   :integer
#  date_sent     :datetime
#  created_at    :datetime
#  updated_at    :datetime
#  postal_id     :integer
#  sugarcrm      :boolean         default(FALSE)
#  status        :string(255)
#

I am unclear as to why I keep getting an ‘undefined method’ — I have added the status attribute (it had been missing before but used a migration and then raked), so need some help…thank you.

  • 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-05-16T22:14:02+00:00Added an answer on May 16, 2026 at 10:14 pm

    Have you restarted your Rails application since you ran your migration? If you’re running in production mode, Rails caches your classes until you restart it, and since status wasn’t an attribute before the migration, Rails wouldn’t have added accessor methods for it, which would explain why status= is undefined.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

This is the error I get undefined method `followed_users?' for #<User:0x007fdadbf11e28> Extracted source (around
I always get this error when trying to compile my file with Boost::GIL PNG
I get this error when trying ruby script/console Rails requires RubyGems >= . Please
I get this error when trying to link a win32 exe project. I have
I'm trying to abort a task in ada program but I get this error
I get this error while using cookie_jar method: Can't call method cookie_jar on an
I need help fixing this error I get when trying to deploy my web
This is the error I get while trying to access a sqlite database from
Trying to track down this error I get when I have NSZombieEnabled . I
I'm trying to get around this error I get from Microsoft Visual Studio 10

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.