开发者

use uploadify in ruby on rails

i'm trying to use the jQuery Uploadify on a Ruby on Rails project. i am able to browse for a file, and select it. the upload progress goes till 100% and then i get a HTTP error. my development.log is below

Processing ApplicationController开发者_Python百科#index (for 127.0.0.1 at 2010-02-07 18:33:01) [POST] Parameters: {"Filename"=>"file.psd", "folder"=>"/uploads", "Upload"=>"Submit Query", "Filedata"=>#<File:/var/folders/j5/j5kRE9LqGzqgPWZPtCoi1k+++TI/-Tmp-/RackMultipart20100207-1470-c8y8uc-0>}


ActionController::RoutingError (No route matches "/javascripts/uploadify.php" with {:method=>:post}): Rendering rescues/layout (not_found)

Anyone knows what's wrong here?


I believe your form action is very wrong - you're using Ruby On Rails, but action submits form to php file.


My guess is you probably have the default catchall routes in your routes.rb file:

map.connect ':controller/:action/:id'
map.connect ':controller/:action/:id.:format'

Remove those lines and it should work.

See this excellent guide for all you need to know about Rails Routes.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜