Hi I want to upload file using rails. I google search find that : http://www.tutorialspoint.com/ruby-on-rails/rails-file-uploading.htm but it can''t not work! I also modify "<%= start_form_tag" to "<%= form_tag" and "<%= end_form_tag %>" to "<% end %>" It still show error message: "Routing Error No route matches [POST] "/upload/uploadFile" " But on routes.rb it included get "upload/uploadFile" and get "upload/index" How to fix the problem ? rails version: 3.1.1 OS : Windows XP Thanks -- Posted via http://www.ruby-forum.com/. -- 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.
2011/11/14 CC Chen <lists-fsXkhYbjdPsEEoCn2XhGlw@public.gmane.org>:> "Routing Error > No route matches [POST] "/upload/uploadFile" " > > > But on routes.rb it included get "upload/uploadFile" and get > "upload/index"Just a quickshot, but... It is complaining about a missing POST-route and your routes.rb containes <get "upload/uploadFile">? Do you see it? HTH Norbert PS: If you do routes for a filetransfer, never ever use GET, GET is not capable of transferring that much of data, use POST instead. AFAIR thats also written in the HTTP-Standard... PPS: If you don''t see it yourself: change <get "upload/uploadFile"> to <post "upload/uploadFile"> -- 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.
On Nov 14, 10:54 am, CC Chen <li...-fsXkhYbjdPsEEoCn2XhGlw@public.gmane.org> wrote:> Hi > > I want to upload file using rails. > > I google search find that :http://www.tutorialspoint.com/ruby-on-rails/rails-file-uploading.htm > > but it can''t not work! > > I also modify "<%= start_form_tag" to "<%= form_tag" > and "<%= end_form_tag %>" to "<% end %>" > > It still show error message: > > "Routing Error > No route matches [POST] "/upload/uploadFile" " > > But on routes.rb it included get "upload/uploadFile" and get > "upload/index" > > How to fix the problem ? >You''re using a really old tutorial, getting on for 5 years old. Routing has changed profoundly in rails since then, in particular if you were adding an uploadFile action, you would need to add a route for that action. I''d strongly suggest you find a more recent tutorial on file uploads. Fred> rails version: 3.1.1 > OS : Windows XP > > Thanks > > -- > Posted viahttp://www.ruby-forum.com/.-- 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.