In Rails how to combine values from three drop downs into a single record for a model
I am building RoR sitre , I have three dropdown li开发者_运维技巧st on a page. i.e. category, subcategory and rank. User can select values for all three drop downs and click "add" button, then by way of jQuery/javascript a row is created on the page as below. User can add upto 10 rows like that.
Category Subcategory Rank
A Sub-1A 1
B Sub-1B 2
B Sub-1B 2
If user has choosen three combination as above , I want to post those three rows to the server and store them in my database model (which has category, subcategory and rank fields) as three records. I do not need to post the dropdown selection BUT the choosen combinations shown as rows.
This is part of the form, which has usual form fileds like first name, last name, address etc. Question is how to do I post this tabular data along with all other fields and access it my controller ?
精彩评论