chaining fields from related tables in form

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

chaining fields from related tables in form

fugee ohu
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>

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/b4123d15-c5b7-42d1-8ac2-24423b01bea4%40googlegroups.com.
Reply | Threaded
Open this post in threaded view
|

Re: chaining fields from related tables in form

mattz
You should use accepts_nested_attributes_for. Look at this link of documentation: https://api.rubyonrails.org/classes/ActiveRecord/NestedAttributes/ClassMethods.html


Em terça-feira, 22 de outubro de 2019 06:55:35 UTC-3, fugee ohu escreveu:
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>

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/0af7db7e-f695-40a2-850f-f1df8fa515e7%40googlegroups.com.
Reply | Threaded
Open this post in threaded view
|

Re: chaining fields from related tables in form

fugee ohu


On Tuesday, October 22, 2019 at 11:46:13 AM UTC-4, mattz wrote:
You should use accepts_nested_attributes_for. Look at this link of documentation: <a href="https://api.rubyonrails.org/classes/ActiveRecord/NestedAttributes/ClassMethods.html" target="_blank" rel="nofollow" onmousedown="this.href=&#39;https://www.google.com/url?q\x3dhttps%3A%2F%2Fapi.rubyonrails.org%2Fclasses%2FActiveRecord%2FNestedAttributes%2FClassMethods.html\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNGcw_qE-NC8yGllLJFiz6bIIh6chw&#39;;return true;" onclick="this.href=&#39;https://www.google.com/url?q\x3dhttps%3A%2F%2Fapi.rubyonrails.org%2Fclasses%2FActiveRecord%2FNestedAttributes%2FClassMethods.html\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNGcw_qE-NC8yGllLJFiz6bIIh6chw&#39;;return true;">https://api.rubyonrails.org/classes/ActiveRecord/NestedAttributes/ClassMethods.html


Em terça-feira, 22 de outubro de 2019 06:55:35 UTC-3, fugee ohu escreveu:
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>

Thanks Decided to watch a couple youtube videos on forms for has_many_through's

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/a6a96876-b325-4fa4-ae5e-dadbd7f45474%40googlegroups.com.