javascript - Hidden field not being passed with dropzone.js in rails app -


i'm using dropzone.js upload several images rails app. idea images belong barco model. have set models, , can see barco_id being passed via url. pass via url id of barco can't images barco_id attribute. it's hidden_field not working...

this new view images, dropzone.js:

<%= form_for(image.new, html: { multipart: true, class: "dropzone"}) |f|  %>   <div class="fallback">      <%= f.file_field :avatar %><br>     <%= f.hidden_field :barco_id %>      <%= f.submit "upload avatar" %>   </div> <% end %> 

thank you!

i got solution! fallback div should wrap avatar field, not others... otherwise ignores rest of fields. final working code:

<%= form_for(image.new, html: { multipart: true, class: "dropzone"}) |f|  %> 

<%= f.file_field :avatar %><br></div> <%= f.hidden_field :barco_id %>  <%= f.submit "upload avatar" %> 

Comments

Popular posts from this blog

angularjs - ADAL JS Angular- WebAPI add a new role claim to the token -

php - CakePHP HttpSockets send array of paramms -

node.js - Using Node without global install -