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 %>
<%= 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