Displaying 2 results from an estimated 2 matches for "relationship_id".
Did you mean:
relationship_ids
2009 Oct 15
2
Model.Save causing nil object error
...=> :relationship_topic
end
class RelationshipTopic < ActiveRecord::Base
validates_uniqueness_of :topic, :scope => :relationship
belongs_to :relationship
belongs_to :topic
end
Now, here is example code of me trying to create a new
RelationshipTopic:
@rel = RelationshipTopic.new(:relationship_id => 1, :topic_id => 1)
=> #<RelationshipTopic id: nil, relationship_id: 1, topic_id: 1,
primary: nil, created_at: nil, updated_at: nil>
>> @rel.save
@rel.save
NoMethodError: You have a nil object when you didn''t expect it!
The error occurred while evaluating nil.text?...
2006 Apr 01
7
Any way around AssociationTypeMismatch?
I want to have popup menus and check boxes in my forms to let users
select associated objects. In the form I''m working on, the object
"belongs_to" another type of object which is selected from a popup menu.
The id of the chosen object(s) for association is passed back in the
parameter hash, but when rails creates a new object from this parameter
hash, I get a