2012-01-20 11 views
0
내 레일 응용 프로그램에서 Jammit을 사용하고 내 서버에이 같은 오류를 얻고있다

: 자바 스크립트 파일이 공공/자바 스크립트/착륙에 살고, 내 assets.yml은 다음과 같습니다파일 이름을 잘못 추가 했습니까?

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

:

내 스타일 시트는 잘 읽히지 만 내 js 파일은 읽지 않습니다. js 파일 이름이 연결되고 두 개의 개별 파일 대신 단일 파일로 읽혀지는 것 같습니다. 무슨 일이 벌어 질지 몰라?

편집 : 여기 내 레이아웃의 머리 모습의 같은 :

<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 %> 

답변

1

Jammits이 파일이에없는 완료 명심을 일반 자산과 동일한 장소. javascript_include_tag과 같은 일반 JavaScript 메서드를 호출 할 수 없습니다. include_javascripts(:front)으로 호출하면 정상적으로 작동합니다.

+0

몰랐습니다. 감사. 그러나, 나는 어떤 javascript_include_tag도 사용하지 않는다. 내 질문을 업데이트하여 내 레이아웃 및보기에 내 및 content_for 태그를 표시했습니다. –

+0

개발 또는 제작 중이십니까? 표시 URL은 정확한 URL인가, Jammit의 버전은 무엇입니까? 당신이 가지고있는 것은 괜찮아 보이고 내가 문제없이 사용하는 것과 같습니다. –

+0

개발 중이며 서버가 localhost의 포트 3000에서 실행 중이므로 URL이 맞습니다. 최신 버전 인 Jammit 버전 0.6.5입니다. –

관련 문제