0

RailsアプリケーションでJammitを使用していますが、サーバーで次のようなエラーが発生します。

NetworkError:404 Not Found- http:// localhost:3000 / javascripts / landing / carousel_background.js / javascripts / landing / front.js "

javascriptファイルはpublic/javascripts / landingにあり、私のassets.ymlは次のようになります。

embed_assets: off
gzip_assets: off
compress_assets: off

javascripts: 
  ....
  front:
    - public/javascripts/landing/carousel_background.js
    - public/javascripts/landing/front.js
  ...

私のスタイルシートはうまく読まれますが、私のjsファイルはありません。jsファイル名が連結され、2つの別々のファイルではなく1つのファイルとして読み取られているようです。何が起こっているのか考えてみませんか?

編集:私のレイアウトの頭は次のようになります:

<head>
<meta http-equiv="Content-type" content="text/html; charset=utf-8" />
<link href='https://fonts.googleapis.com/css?family=Open+Sans:300italic,300' rel='stylesheet' type='text/css' />


<%= render 'shared/title' %>

<%= render 'shared/import_styles' %>
<%= yield :stylesheets %> 
<%= render 'shared/import_ie_styles' %>

<%= include_stylesheets :landing, :media => :all %>

<%= render 'shared/import_scripts' %>
<%= include_javascripts :landing %>

<%= yield :head %>

<%= render 'shared/google_analytics' %>
<%= csrf_meta_tag %>

<%= favicon_link_tag %>
</head>

私のビューには次のcontent_forタグがあります。

<% content_for :head do %>
  <%= include_javascripts :front %>
<% end %>

<% content_for :stylesheets do %>
  <%= include_stylesheets :front, :media => :all %>
<% end %>
4

1 に答える 1

1

Jammitsの完成したファイルは、通常のアセットと同じ場所にはないことに注意してください。などの通常のJavaScriptメソッドを呼び出すことはできません。呼び出すと、正常に機能するはずですjavascript_include_taginclude_javascripts(:front)

于 2012-01-20T17:14:11.217 に答える