RailsCasts Pro episodes are now free!
Learn more or hide this
GitHub User: adsteel
Site: www.coelevation.com
Try this, it worked for me.
http://stackoverflow.com/questions/17719660/rails-4-csv-import-and-setting-a-value-to-a-key-value
Anyone have any tips for adding a foreign key? Say in Ryan's example, Factory had many Products, and one wanted to upload Products from a CSV that did not contain a foreign key to the Factory each Product belonged to. Thanks!
Hammer, you need an equal sign after '<%', before 'submit_tag', like this:
'<%= submit tag "Import" %>'
Good luck!
Try this, it worked for me.
http://stackoverflow.com/questions/17719660/rails-4-csv-import-and-setting-a-value-to-a-key-value
Anyone have any tips for adding a foreign key? Say in Ryan's example, Factory had many Products, and one wanted to upload Products from a CSV that did not contain a foreign key to the Factory each Product belonged to. Thanks!
Hammer, you need an equal sign after '<%', before 'submit_tag', like this:
'<%= submit tag "Import" %>'
Good luck!