jquery-nested_attributes
jquery-nested_attributes copied to clipboard
If the only input is <select> it can't figure out collection names
I believe when it finds the relevant inputs for the fields it uses this selector:
https://github.com/patbenatar/jquery-nested_attributes/blob/master/jquery.nested_attributes.coffee#L33
So when it tries to figure out the collection name it can't because the select tag is never found.
<3
@bobbytables thanks for the report! Looking at the code you highlighted I'm not sure why <select>
tags wouldn't match since we're using the :input
selector which is supposed to many any type of input, including <select>
. From the docs:
Selects all input, textarea, select and button elements.
In any event, this is worth looking into more. We've had several issues with collection auto-detection and this code could probably use some tuning.
@bobbytables would you be able to post a failing example?
On Tue, Sep 24, 2013 at 12:21 PM, Brendan Loudermilk [email protected] wrote:
@bobbytables thanks for the report! Looking at the code you highlighted I'm not sure why
<select>
tags wouldn't match since we're using the:input
selector which is supposed to many any type of input, including<select>
. From the docs:Selects all input, textarea, select and button elements.
In any event, this is worth looking into more. We've had several issues with collection auto-detection and this code could probably use some tuning.
Reply to this email directly or view it on GitHub: https://github.com/patbenatar/jquery-nested_attributes/issues/10#issuecomment-25029517
Yeah if I have time tonight I'll try to see whats going on. It might be a change in Rails 4 fields_for ......? Maybe....?
Might be.. Don't believe I've used it with 4 yet. If you could just post the rendered HTML and associated JS init code that'd be a big help :thumbsup:
On Tue, Sep 24, 2013 at 12:28 PM, Robert Ross [email protected] wrote:
Yeah if I have time tonight I'll try to see whats going on. It might be a change in Rails 4 fields_for ......? Maybe....?
Reply to this email directly or view it on GitHub: https://github.com/patbenatar/jquery-nested_attributes/issues/10#issuecomment-25030209