I’m having problems adding a new table row by clicking the link_to_add function link.
I’m having problems adding a new table row by clicking the link_to_add function link.
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
As it took me some search and try&error to find out here is my solution. The key to it was using the cocoon gem by nathanvda (instead of nested_form by ryanb) that allows to define a jquery selector (called
data-association-insertion-node) on where to insert the new fieldset. In my example I’m using HAML and Twitter Bootstrap code, but you can easily replace it with your own favorites./app/views/users/_form.html.haml:/app/views/users/_user_event_fields.html.haml:Please note that the
.nested-fieldsclass on the tag is essential for the remove link to work.