-
Notifications
You must be signed in to change notification settings - Fork 1k
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
Add hiddenPrefix, hiddenSuffix crashes Rails/Rack webservers #208 #209
Conversation
👍 |
I will look into this and merge in soon. Thanks! |
It's likely that for Rails the behavior you want is actually to have no prefix or suffix at all. That way Rails will use the value of the latter (hidden) input field. This is the same pattern, i.e. two inputs with identical names, with the value of the second one actually being submitted, that Rails relies on to make sure that checkboxes always submit a value (false for unchecked). |
This has been included with v3.3 Cheers! |
Would it be possible to contribute a note about Ruby on Rails implementation in the docs? I had the exact same issue as above in my Ruby on Rails app, getting:
It would have helped me greatly to have an example or note to clear the hiddenPrefix and hiddenSuffix when using Rails:
|
I think that the problem isn't solved yet. When I submit my form with hiddenSuffix: ''' the component sends the same attribute twice: the first with value and the second blank. Like this: So Rails will save blank. |
Use a different prefix and merge them in the controller if it is present. On Mon, Oct 28, 2013 at 3:41 PM, Marco Rojo [email protected]:
|
It may be helpful to note that in my configuration which is working, the input field's HTML name attribute appears below. Once it had this formatting, it worked without modification to the controller. It threw the error until I had cleared out both hiddenPrefix and hiddenSuffix:
On Rails 4.0.0, Ruby 2.0.0p195, sqlite3 database |
Adds new option hiddenPrefix that if it is set overrides hiddenSuffix