Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
bobbytables opened this issue Sep 24, 2013 · 4 comments
Open

Comments

@bobbytables
Copy link

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

@bloudermilk
Copy link
Collaborator

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

@patbenatar
Copy link
Owner

@bobbytables would you be able to post a failing example?

On Tue, Sep 24, 2013 at 12:21 PM, Brendan Loudermilk
notifications@github.com 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:
#10 (comment)

@bobbytables
Copy link
Author

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

@patbenatar
Copy link
Owner

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 👍

On Tue, Sep 24, 2013 at 12:28 PM, Robert Ross notifications@github.com
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:
#10 (comment)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants