jquery-nested_attributes icon indicating copy to clipboard operation
jquery-nested_attributes copied to clipboard

If the only input is <select> it can't figure out collection names

Open bobbytables opened this issue 11 years ago • 4 comments

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 avatar Sep 24 '13 04:09 bobbytables

@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.

bloudermilk avatar Sep 24 '13 18:09 bloudermilk

@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

patbenatar avatar Sep 24 '13 18:09 patbenatar

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....?

bobbytables avatar Sep 24 '13 18:09 bobbytables

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

patbenatar avatar Sep 24 '13 18:09 patbenatar