expected Hash (got String) for param `date'
See original GitHub issueWhen using pickadate in Rails, I get the following error when submitting a form:
expected Hash (got String) for param `date’
Here is my form and schema for the two fields: https://gist.github.com/DevanB/6551291
I can remove pickadate classes from the fields, and everything works fine, but when those two fields have the pickadate classes, I get that error.
Thanks for any help guys!
Issue Analytics
- State:
- Created 10 years ago
- Comments:7 (2 by maintainers)
Top Results From Across the Web
TypeError (expected Hash (got String) for param `content
I'm currently trying to add widgEditor to a form in ruby on rails however whenever I hit submit I get ...
Read more >Solved: expected String to be a Hash - Shopify Community
I have a problem on creating Fulfillment or creating a test transaction. I followed the documentation in REST API but still got and...
Read more >A brand new website interface for an even better experience!
Invalid querystring leads to status 500 (TypeError: expected Hash (got Array) for param) ... Backers, Amount, Date. Updates. IN PROGRESS. BOUNTY TOO LOW....
Read more >Rails Form helpers - Ruby on Rails Guides
When the form is submitted, the name will be passed along with the form data, and will make its way to the params...
Read more >Customer Information Parameters - Conversions API
string. Do not hash. The IP address of the browser corresponding to the ... for how to get this value or generate this...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Turns out the error is caused by the hidden
_submit
field. Apparently Rails doesn’t like fields named like thisobject[field_name]_submit
.But is it even normal to have a field named like this ? I’ve never seen anything like it. Maybe what you meant to do with the suffix was to have something like
object[field_name_suffix]
. Didn’t you ?Anyway, to get rid of the error I’ve just set the hiddenSuffix option to empty string:
hiddenSuffix: ''
. Worked for pickatime too.The following snippet provides a workaround, which converts hidden attributes
foo[bar]_submit
tofoo[bar_submit]
(notation as suggested by jerefrer).I hope we can fix this properly in the library, the workaround is rather hackish.