2012-07-04 1 views
0

파일 레일 통합 할 수 있습니다 라이브러리를 "top_vendors"div에 추가하십시오.) 1 내 자산에 jQuery를 축소 된 라이브러리 복사/자바 스크립트가 2 폴더) : 는 어떻게이의 jQuery를 스크롤 UI 요소가 I이 파일이

나는 내가 장소에서 다음 단계가 지금까지

성공 haevn't 그러나 가이드 라인으로 this 튜토리얼 보았다 거기에 jqueryUI 라이브러리 복사 됨 3) 쿠퍼 티노 테마 이미지를 스타일 시트/이미지로 복사했습니다. 4) jquery-ui - .. custom.css 파일을 스타일 시트 폴더 에 복사했습니다. 5) 여기에 내 application.js의 헤드 태그가 있습니다. 파일

<!DOCTYPE html> 
<html> 
<head> 
<title>App0521</title> 
<!--[if lt IE 9]> 
<script src="http://html5shim.googlecode.com/svn/trunk/html5.js" type="text/javascript"></script> 
<![endif]--> 
<%= stylesheet_link_tag 'jquery-ui-1.8.21.custom.css', "application", :media => "all" %> 
<%= javascript_include_tag 'jquery-1.4.2.min.js ', 'jquery-ui-1.8.2.custom.min.js',"application" %> 
<%= csrf_meta_tags %> 
<meta name="viewport" content="width=device-width, initial-scale=1.0"> 
</head> 

브라우저에서 여전히 스크롤 막대가 보이지 않습니다.

무엇이 누락 되었습니까? 감사합니다.

답변

1

CSSJS을 모두 application.html.erb에 포함 할 필요는 없습니다. 당신은 assets/javascript 폴더에

application.html.erb:

<%= stylesheet_link_tag "application", :media => :all %> 
<%= javascript_include_tag "application" %> 

저장을 .. 당신을 위해 그것을 포함하도록 js 파일을 레일을 구성 할 수 있습니다하고는 application.js

에 포함

//= require jquery 
//= require jquery_ujs 
//= require jquery-ui  #here you are including the jQUERY-UI 
//= require_tree . 
를 application.js

또한 application.js에서에 함수를 만들어야합니다.(나는 그것이 당신을 위해 없다고 생각합니다).

당신은 예를 들어 귀하의 ID #top_vendorsslide를 호출 할 경우

:

$(function() { 
    $("#top_vendors").slider(); 
}); 

같은 다른 jQuery-UI pluging에 대해 수행 할 수 있습니다.

도움이되기를 바랍니다.

+0

안녕하세요, 답변 해 주셔서 감사합니다. 그 여전히 작동하지 않습니다 : ( 위의 모든 위치에 있습니다.이 디버깅을 시작할 수있는 모든 제안을 – banditKing

+0

또한 jquery + 레일에 대한 자습서를 얻을 수있는 모든 아이디어. 모든 자습서 이전 버전에 대한 것 같습니다 – banditKing

+0

[google API] (https://developers.google.com/speed/libraries/devguide)를 통해 라이브러리를 추가하십시오.이 줄을 application.html.erb에 추가하십시오.''을 다운로드하는 대신 – gabrielhilal