我绝不是一个Ruby开发人员,但我在我的本地主机上为ruby框架编写HAML代码。我的rails ApplicationController有一个RoutingError
我最初把一个名为vidgirlBox2.flv文件的文件并在HAML中调用它,但将该文件转换为名为vidGirl_home.swf的swf。
这个瑞士法郎工作。
直到我对原始.fla进行了简单更改并覆盖了vidGirl_home.swf。
它再也没有工作过。
我试过swfObject,Unobtrusive Flash Object,这是嵌入swf的最低要求,一切。
事实证明,我在终端运行我的本地服务器时得到这个消息:
ActionController::RoutingError (No route matches "/Users/daniellevine/Desktop/vidgirlBox2.flv" with {:method=>:get}):
Rendering rescues/layout (not_found)
正如你所知道的,它找一个旧文件。我没有在我的任何haml中调用这个文件。我很困惑这个flv是如何写入ruby的(这是我至少假设的)。
这是我在解决方法的尝试,但似乎这个代码会生成一个rails编译器错误。这可能只是一个简单的命名约定错误。我在某处丢失了一个引号吗?
我的新嵌入代码:
- if Rails.env.development?
= javascript_include_tag "swfobject"
- else
%script{:src => "http://ajax.googleapis.com/ajax/libs/swfobject/2.1/swfobject.js"}
- id ||= "flash"
- filename ||= "/images/vidGirl/vidGirl_home.swf"
- width ||= 440
- height ||= 247
- background ||= "#ffffff"
- version ||= 9
- base ||= '{base: "."}'
%div{ :id => id }
%strong You need to upgrade your Flash Player
= javascript_tag "swfobject.embedSWF('/images/vidGirl/vidGirl_home.swf', 'vidGirl_home', '440', '247', '9.0.0', '/javascripts/swfobject/expressInstall.swf', {}, '/public/', {});"
任何人都知道到底发生了什么?或更好,如何解决这个问题?
谢谢!
我有我正在试图从公共场合绘制的集合,但没有运气。我猜这里有几个问题。 – Trip 2009-06-10 22:41:04
你可以在这里粘贴你的嵌入/ swfobject代码吗? – Callmeed 2009-06-11 00:40:47
%对象{:width =>“550”,:height =>“400”} %param {:name =>“movie”,:value =>“/ images/vidGirl_home.swf”} %embed { src =>“/ images/vidGirl_home.swf”,:width =>“550”height =“400”} – Trip 2009-06-11 01:09:05