ruby - Rails Nested Model Form -


At the moment I have three models:

  There are many selectists in the list of songs in the songs   

At this time my form looks like:

   & Lt;% = f.date_select: Date% & gt; & Lt; Div & gt; & Lt;% = Render 'song'% ' & Lt; / Div & gt; & Lt;% = f.submit "Create Setlist", Category: "BTN BTN-Large BTN-Primary"%>   

The above lyrics are partial:

  & lt; Div id = "songSelection" & gt; & Lt; Table class = "table-table-striped table-limit" & gt; & Lt; Thead & gt; & Lt; Th & gt; Title & lt; / Th & gt; & Lt; Th & gt; Artist & lt; / Th & gt; & Lt; Th & gt; Add to set & lt; / Th & gt; & Lt; / Thead & gt; & Lt; Tbody & gt; & Lt;% @ songs.each do | Song & Gt%; & Lt; TR & gt; & Lt;% = nested_form_for (@setlist.allocations.build (song_id: song.id)) Producer | & Gt%; & Lt; Td> & Lt;% = song.title% & gt; & Lt; / Td> & Lt; Td> & Lt;% = song.artist% & gt; & Lt; / Td> & Lt; TD & gt; & Lt;% = builder.submit "Add Song", Class: "BTN BTN-BTN-Primary"%> & Lt;% end% & gt; & Lt; / TD & gt; & Lt; / TR & gt; & Lt;% end% & gt; & Lt; / Tbody & gt; & Lt; / Table & gt; & Lt; / Div & gt; Actually I am trying to give the list to the Settleist through allocation. At the moment it says that f f in the song is not partially defined. If I get rid of it then the page fixes but does not work properly (ie whenever I click on the button to add a song that resets it, it changes the date of the Settleist Saves but does not give any new allocation). Any help would be much appreciated. I realized that I can not lose the information because I am somewhat new to it, so if any additional details are required please ask.  

I tried to use the nested form gem by Ryan Bates, but I did not find it work, I think it is because it is not specifying a song id for the allocation When it goes to try and make it, but it is not certain that I / post-less "itemprop =" text ">

try

Comments