search for: attr_a

Displaying 1 result from an estimated 1 matches for "attr_a".

Did you mean: attr_1
2012 Sep 04
5
Associations and Math between Models
...to get an attribute from model_1 to use in a method in model_2. When I use the code below, I get an error saying ''undefined method model_1_id''. What am I missing? Thanks! Model_2.rb Class Model_2 < ActiveRecord::Base ... has_and_belongs_to_many :model_1 def some_method attr_a * Model_1.find(model_1_id).attr_I_need end -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, s...