Arup Rakshit
2014-May-26 19:06 UTC
TypeError (can't cast Enumerator to string): - Ruby on Rails
Hi,
When I am trying to upload a file through the url -
http://0.0.0.0:3000/upload/get . I am getting an error as
Started POST "/upload/save" for 127.0.0.1 at 2014-05-27 01:29:29 +0530
Processing by UploadController#save as HTML
Parameters: {"utf8"=>"✓",
"authenticity_token"=>"khU59z0DsXoVyHeu4XNaUb7TEpSWZ9id4dJTbVu6efU=",
"picture"=>{"comment"=>"dfgjk",
"uploaded_picture"=>#<ActionDispatch::Http::UploadedFile:0xa939838
@tempfile=#<Tempfile:/tmp/RackMultipart20140527-11473-10esj62>,
@original_filename="sfnzf.png", @content_type="image/png",
@headers="Content-
Disposition: form-data; name=\"picture[uploaded_picture]\";
filename=\"sfnzf.png\"\r\nContent-Type: image/png\r\n">},
"commit"=>"Upload
file"}
(0.2ms) begin transaction
Binary data inserted for `string` type on column `content_type`
(0.1ms) rollback transaction
Completed 500 Internal Server Error in 5ms
TypeError (can't cast Enumerator to string):
app/controllers/upload_controller.rb:8:in `save'
=============================
I am reading a book and trying out stuffs and got stuck here. My little
tutorial is uploaded here -
https://github.com/aruprakshit/chap_21_agile_rails .
Please help me to understand what wrong am I doing here.
--
===============Regards,
Arup Rakshit
--
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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
To post to this group, send email to
rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
To view this discussion on the web visit
https://groups.google.com/d/msgid/rubyonrails-talk/4300092.lHdYofBXmi%40linux-wzza.site.
For more options, visit https://groups.google.com/d/optout.