Hello everybody,
i need to manage file uploads with a new rails application.
I proceded as i did with rails2
- declared the form as multipart
<%= form_for(@photo, :html => {:multipart => true}) do |f| %>
- and added the file_field tag
<%= f.label :uploaded_data %><br />
<%= f.file_field :uploaded_data %>
the form shows up correctly, but after submit i receive an error:
500 Internal Server Error
If you are the administrator of this website, then please read this
web application''s log file and/or the web server''s log file to
find
out what went wrong.
in the server log i get this:
TypeError (can''t convert nil into Integer):
the controller is still the one produced by the "rails scaffold", so
it should work fine (obviously i don''t expect it to really save the
file).
What am i missing?
Using:
ruby -v
ruby 1.9.2p0 (2010-08-18 revision 29036) [x86_64-darwin10.4.0]
rails --version
Rails 3.0.0
--
You received this message because you are subscribed to the Google Groups
"Ruby on Rails: Talk" group.
To post to this group, send email to
rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
To unsubscribe from this group, send email to
rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en.