Angelo Cordova
2011-Jul-19 21:32 UTC
Problem with nested form using collection_select and date_select
Hello people I have a table named Items. Items belongs_to inventory, and Items belongs_to product. so items looks like Item -id -inventory_id -product_id -date -comments The main idea is that I want to create an item while I''m creating the inventory by using nested form in the inventory form (I already test creating item with its own methods and forms and works fine), and I get an error message saying that "product_id" is null and it shouldn''t be null (because of foreign key restriction). In the items form I have a collection select to display the name of product, instead of just the id of the product, but when I check the sql, product_id is a null value. The same happens with date. I have a date_select in the form, but the sql shows a null value. I''ve already used nested form and worked fine, but now, I don''t know what''s the probl em. I followed this tutorial http://guides.rubyonrails.org/getting_started.html#building-a-multi-model-form Hope you can help me thanks -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.