【发布时间】:2011-02-16 12:50:51
【问题描述】:
我有一个从 rails 加载 swf 文件 flaMovie.swf 的请求。 swf 文件位于目录 /home/user1/railsproj/flash。
我在视图目录下有代码 index.rhtml 来显示 .swf 文件,
ID=flaMovie 宽度=250 高度=250>
当我运行代码时,我得到了错误,
ActionController::RoutingError(没有路由匹配“/home/user1/railsproj/flash/flaMovie.swf”与 {: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'
我的 rails 项目位于 /home/user1/railsproj ,网络服务器是 Mongrel 网络服务器。
如何在 rhtml 文件中指定路径,以便 Mongrel 服务器能够定位到该文件?非常感谢,
【问题讨论】:
标签: ruby-on-rails mongrel filepath