I'm currently trying to add widgEditor to a form in ruby on rails however whenever I hit submit I get the following error:
TypeError (expected Hash (got String) for param `content'
The form code is as follows:
<div class="field">
<%= f.label :content %><br />
<%= f.text_area :content, :cols => "20", :rows=>"4", :class=>"widgEditor" %>
</div>
<div class="actions">
<%= f.submit %>
</div>
has anyone got any experience with this issue?
for others who met the same problem:
this error is caused when you have two fields in your form like:
video: 'some string'
video['url']: 'some url'
then rails will crash with the error: expected Hash (got String) for param
the solution is quite simple: change 'video' to something else. e.g.:
video_origin_url: 'some string'
video['url']: 'some url'
see this question also: https://stackoverflow.com/a/19246703/445908
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With