I have a simple form , with a file field
= form_for (Clip.new), :html => {:multipart => true} , :remote =>
true , do |f|
= f.hidden_field :user_id, {:value => current_user.id}
= f.text_field :name
= f.text_area :description
= f.file_field :image
= f.submit I18n.t(:add)
generating the html code
...
which seems to be OK ( compared to tutorial …)
but when if I check the params sent in my controller , I DON’T GET
the clip[image] …
(rdb:9) params
{“utf8”=>“✓”, “authenticity_token”=>“1ovVVdl+oh17phaR4ZVMc/wZpL5v07YMBh
+KsEqjTpk=”,
“clip”=>{“user_id”=>“9”, “name”=>“test”, “description”=>“testing image
upload”},
“commit”=>“Add”, “action”=>“create”, “controller”=>“clips”,
“locale”=>“en_GB”}
I should have the image upload data :
“image”=>#<ActionDispatch::Http::UploadedFile:0…
@original_filename="…", @content_type=“image/jpeg”, @headers=…
@tempfile=#<File:/var/folders/NK/N…>>
what could be wrong ? is the remote-true incompatible ?