Ruby on Rails Wednesday, August 16, 2017

I'm mounting the uploader on a string  field, :name
In my form
<%= f.file_field :name %>
When the form submits this is what gets logged:

Started POST "/user/pictures/new" for 127.0.0.1 at 2017-08-16 05:27:01 -0400
Processing by UserPicturesController#create as HTML
  Parameters: {"utf8"=>"���", "authenticity_token"=>"rbCey3lEepNFfTK//Jc4/DlvP+BX92eKi1TI2508Q3f7UM+ADD8L39zORKtC9zU3xY3RS2FWKbX6DyIg/x/O+w==", "picture"=>{"imageable_id"=>"436", "imageable_type"=>"PressRelease", "comment"=>"", "name"=>#<ActionDispatch::Http::UploadedFile:0x0000000a230f00 @tempfile=#<Tempfile:/tmp/RackMultipart20170816-11656-q784t1.jpeg>, @original_filename="icecream.jpeg", @content_type="image/jpeg", @headers="Content-Disposition: form-data; name=\"picture[name]\"; filename=\"icecream.jpeg\"\r\nContent-Type: image/jpeg\r\n">}, "commit"=>"Create Picture"}
 
Above in the log "name" isn't  "icecream.jpeg" which is what's expected The validation returns:

2 errors prohibited this picture from being saved:

  • Name can't be blank
  • Name translation missing: en.errors.messages.mini_magick_processing_error

I'm confused Anyone can help? Thanks in advance

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-talk+unsubscribe@googlegroups.com.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/6b455a9d-f604-48d1-9907-1ad1ae5a1fd9%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

No comments:

Post a Comment