chaining fields from related tables in form

101 views
Skip to first unread message

fugee ohu

unread,
Oct 22, 2019, 5:55:35 AM10/22/19
to Ruby on Rails: Talk
In my case Item has_many :item_item_properties
In form_for item I'm trying to put the field for item_item_properties but rails says
undefined local variable or method `item_item_properties' for #<#<Class:0x00559a982ed898>:0x00559a97deee50>

mattz

unread,
Oct 22, 2019, 11:46:13 AM10/22/19
to Ruby on Rails: Talk
You should use accepts_nested_attributes_for. Look at this link of documentation: https://api.rubyonrails.org/classes/ActiveRecord/NestedAttributes/ClassMethods.html

fugee ohu

unread,
Oct 22, 2019, 1:45:22 PM10/22/19
to Ruby on Rails: Talk
Thanks Decided to watch a couple youtube videos on forms for has_many_through's
Reply all
Reply to author
Forward
0 new messages