I am trying to add a jquery upload But i need to pass a parameter into my form
Here the form
<%= form_for Photo.new do |f|%>
<%= f.label :title %><br />
<%= f.text_area :title, :rows => 3, :value => "Add a photo", :onclick=>"this.value='';" %>
<%= f.file_field :photo, multiple: true %>
<%= f.hidden_field('event_id', params[:event_id]) %>
<%= f.submit "Add Picture" %>
<% end %>
But this doesn't work, the issue is I have a link has follow localhost/events/16/photos/useradd
where 16 is the event_id params. How can i place it into my hidden field so it is send afterwards?
UPDATE
NoMethodError in Photos#useradd
Showing /home/jean/rail/voix/app/views/photos/useradd.html.erb where line #13 raised:
undefined method `merge' for "16":String
that the error and 16 is my event_id