I tried this and got an error.
My stuff was based on this website -
http://www.tutorialspoint.com/ruby-on-rails/rails-file-uploading.htm.
I wanted a photo stored in images/user-id/ whereas this only uses
images/. So if I remove the user-id directory, and do this, I still
get an empty file.
Thanks for you replies - I need to think my rails usage.
On Mar 3, 12:11 pm, MaD <[email protected]> wrote:
> for your view, if in doubt use this instead of <%= f.file_field
> ("uploaded_picture") %>
>   <input type="file" name="chosen_file" />
>
> in your controller (the line you commented out):
>   File.new(path, "wb") { |f| f.write(params[:chosen_file].read) }
>
> if i didn't miss anything, this should do the trick.
--~--~---------~--~----~------------~-------~--~----~
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 [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to