Javascript 将AdobeEdge脚本添加到Rails资产管道

Javascript 将AdobeEdge脚本添加到Rails资产管道,javascript,jquery,ruby-on-rails,asset-pipeline,adobe-edge,Javascript,Jquery,Ruby On Rails,Asset Pipeline,Adobe Edge,这可能是将具有依赖关系的外部脚本引入Rails的简单情况 我正在尝试让我的Adobe Edge生成的动画在我的Rails应用程序中运行,第一步是包含所有Adobe Edge生成的js文件,但到目前为止,我只得到了一堆404未发现错误,用于Application.js文件中包含的所有Edge文件 这是我的Application.js文件 //= require jquery //= require jquery_ujs //= require underscore //= require back

这可能是将具有依赖关系的外部脚本引入Rails的简单情况

我正在尝试让我的Adobe Edge生成的动画在我的Rails应用程序中运行,第一步是包含所有Adobe Edge生成的js文件,但到目前为止,我只得到了一堆404未发现错误,用于
Application.js
文件中包含的所有Edge文件

这是我的Application.js文件

//= require jquery
//= require jquery_ujs
//= require underscore
//= require backbone
//= require california_internet
//= require hero_edgePreload
//= require edge_includes/edge.1.5.0.min
//= require hero_edge
//= require hero_edgeActions
下面是Edge的preload.js如何尝试查找一些文件

aLoader=[{load:"edge_includes/jquery-1.7.1.min.js"},{load:"edge_includes/edge.1.5.0.min.js"},{load:"hero_edge.js"},{load:"hero_edgeActions.js"}]

我实现这一点的方法是将
hero\u edgepload.js
更改为
hero\u edgepload.js.erb

和变化:

aLoader=[
  {load:"edge_includes/jquery-1.7.1.min.js"},
  {load:"edge_includes/edge.1.5.0.min.js"},
  {load:"hero_edge.js"},
  {load:"hero_edgeActions.js"}
];
致:

aLoader=[
//{load:“edge_includes/jquery-1.7.1.min.js”},在application.js中已经是必需的
{加载:''},
{加载:''},
{加载:''}
];
您也可以在
application.JS
中从应用程序中删除任何Adobe Edge JS文件

您必须将
asset\u path
添加到
hero\u edge.js
中的任何图像中,并将其更改为
hero\u edge.js.erb


如果有更简单的方法,我很想知道:)

Michael Johnston关于更改Edge的aLoader路径的解决方案是有效的,但会出现错误。在localhost上时,我会得到
未捕获的HierarchyRequestError:一个节点被插入到它不属于的地方。
随机插入,而在每次页面刷新时部署到Heroku之后

此外,我的应用程序依赖于更高版本的jQuery,因此添加来自Edge动画的jQuery可能会导致冲突

经过反复试验,我决定使用此解决方案:

  • 将整个动画放入
    /public/edge
    文件夹中
  • 将动画放入iframe:
  • 这不是最优雅的一款,但肯定可以省去很多麻烦

    aLoader=[
      // {load:"edge_includes/jquery-1.7.1.min.js"}, Already required in application.js
      {load:'<%= asset_path("edge.1.5.0.min.js") %>'},
      {load:'<%= asset_path("hero_edge.js") %>'},
      {load:'<%= asset_path("hero_edgeActions.js") %>'}
    ];