W3cubDocs

/Ruby on Rails 5.1

class ActiveModel::MissingAttributeError

Parent:
NoMethodError

Raised when an attribute is not defined.

class User < ActiveRecord::Base
  has_many :pets
end

user = User.first
user.pets.select(:id).first.user_id
# => ActiveModel::MissingAttributeError: missing attribute: user_id

© 2004–2017 David Heinemeier Hansson
Licensed under the MIT License.