Re: [Rails] build method and nested forms

6 views
Skip to first unread message

Ariel Juodziukynas

unread,
Nov 2, 2019, 9:13:12 AM11/2/19
to rubyonra...@googlegroups.com
What do you mean that "pet's attributes can't be found"? found where? how? show the code that doesn't work for you.

El sáb., 2 nov. 2019 a las 4:30, fugee ohu (<fuge...@gmail.com>) escribió:
if i  @users.pets.build then in my form I'll have  <%= f.fields_for :pets do |pet| %> will iterate the same number of times as @user.pets.size but pet's attributes can't be found in :pet although they're available in @users.pets.attributes So I have to use : and @ together in the same form to display values from the object created in the controller by build?

--
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 rubyonrails-ta...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/8995111c-edd7-4047-a75e-0f62b2a464ae%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages