Hi List, I''m Jen and this is my first post :P I won''t bore you with pages of introduction, so here is my problem/question. I''m pretty new to web programming and rails. I''ve been looking for a simple way to upload files to a directory, so I can use GIT to version them etc. I don''t want anything stored in a database. I''m trying to adapt code from a tutorial and blog, but looking at the blog comments no one seemed to be able to get it working. The link to the blog is: rails: File upload in rail <http://railshafeez.blogspot.com/2009/02/image-uploading-with-plugin.html> The blog contains the link to the tutorial. <http://railshafeez.blogspot.com/2009/02/image-uploading-with-plugin.html> The form I have adapted renders OK, but when I try to submit a file for upload I get the following result: NoMethodError in UploadController#create undefined method `original_filename'' for nil:NilClass | | |Rails.root: /home/resource_portal/website| My controller, model and view are attached. I''m using Ruby-1.9.2 and Rails3 Any help with this would be great. Thanks in advance, Jen. -- 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.
Frederick Cheung
2011-May-15 18:49 UTC
Re: Looking for a quick and simple way to upload files?
On May 15, 4:59 pm, Jen <jen.bot...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> Hi List, > > I''m Jen and this is my first post :P > > I won''t bore you with pages of introduction, so here is my problem/question. > > I''m pretty new to web programming and rails. I''ve been looking for a > simple way to upload files to a directory, so I can use GIT to version > them etc. I don''t want anything stored in a database. > > I''m trying to adapt code from a tutorial and blog, but looking at the > blog comments no one seemed to be able to get it working. The link to > the blog is: > > rails: File upload in rail > <http://railshafeez.blogspot.com/2009/02/image-uploading-with-plugin.html> > > The blog contains the link to the tutorial. > <http://railshafeez.blogspot.com/2009/02/image-uploading-with-plugin.html> > The form I have adapted renders OK, but when I try to submit a file for > upload I get the following result: >There''s a mistake in those instructions - given that the file_field is called :upload, the save method should be using upload[''upload''] Fred> NoMethodError in UploadController#create > > undefined method `original_filename'' for nil:NilClass > > | > | > > |Rails.root: /home/resource_portal/website| > > My controller, model and view are attached. I''m using Ruby-1.9.2 and Rails3 > > Any help with this would be great. > > Thanks in advance, > Jen. > > upload_controller.rb > < 1KViewDownload > > data_file.rb > < 1KViewDownload > > upload.rhtml > < 1KViewDownload-- 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@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.