Hello all,
I about to pull my hair out.
I have two models "Activities" and "Activity_types"
Activities
Hello all,
I about to pull my hair out.
I have two models "Activities" and "Activity_types"
Activities
You've got your has_many and belongs_to backwards.
Thanks Mat, That did it. I checked with debug and how do I get the type Name?
John
You should probably familiarize yourself with this:
if I include ":include => :activity_type", then I get the name.
debug @activities
- !ruby/object:Activity activity_type: &id001 !ruby/object:ActivityType attributes: name: Budgeting created_at: 2010-01-25 14:38:25 updated_at: 2010-01-25 14:38:25 id: "1" attributes_cache: {}
attributes: name: Study Mapping & Budget Workup created_at: 2010-01-25 14:44:51 updated_at: 2010-01-25 14:44:51 activity_type_id: "1" id: "1" attributes_cache: {}
How to display "name"?
John
Thanks for help.
John
activity.activitytypes.name