开发者

how to specify the file path in rails over Mongrel web server

I have a request to load a swf file, flaMovie.swf from rails. The swf file is located the directory /home/user1/railsproj/flash.

I have the code index.rhtml under view directory to show the .swf file,

ID=flaMovie WIDTH=250 HEIGHT=250>

开发者_如何学Go

When I ran the code, I got the error,

ActionController::RoutingError (No route matches "/home/user1/railsproj/flash/flaMovie.swf" with {:method=>:get}): /vendor/rails/actionpack/lib/action_controller/routing.rb:1441:in recognize_path' /vendor/rails/actionpack/lib/action_controller/routing.rb:1424:inrecognize' /vendor/rails/actionpack/lib/action_controller/dispatcher.rb:170:in handle_request' /vendor/rails/actionpack/lib/action_controller/dispatcher.rb:115:indispatch' /vendor/rails/actionpack/lib/action_controller/dispatcher.rb:126:in dispatch_cgi' /vendor/rails/actionpack/lib/action_controller/dispatcher.rb:9:indispatch' /usr/lib/ruby/gems/1.8/gems/mongrel-1.1.5/bin/../lib/mongrel/rails.rb:76:in process' /usr/lib/ruby/gems/1.8/gems/mongrel-1.1.5/bin/../lib/mongrel/rails.rb:74:insynchronize'

My rails project is located in /home/user1/railsproj and the web server is Mongrel web server.

How to specify the path in the rhtml file so that Mongrel server is able to locate the file? Thanks a lot,


Put your file in public directory inside your project directory and path to it is just yourserver.com/flaMovie.swf.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜