2014-06-13 66 views
0

我有幾個JavaScript的插件,在我的應用程序已經和他們的工作找到(選擇2,自舉的DateTimePicker,CKEditor的王牌,chartkick)jQuery的UI和Rails4

試圖讓jQuery的UI運行添加一些排序列表/表。

無法獲得jQuery的UI在軌道4應用程序運行......

# Gemfile 
gem 'therubyracer', platforms: :ruby 
gem 'jquery-rails'       
gem 'jquery-ui-rails' 
gem 'non-stupid-digest-assets', '~> 1.0.4' 

# app/assets/javascripts/application.js 
//= require jquery 
//= require jquery_ujs 
//= require turbolinks 
//= require_tree . 
// = require jquery.ui.all 

# app/views/rates/show.html.erb 
<ul id="rates"> 
<% @plan.rate_items.each do |rate| %> 
    <%= content_tag_for(:li, rate) do %> 
    <%= rate.name %> 
    <% end %> 
<% end %> 
</ul> 

<%= content_for :page_javascript do %> 

<script> 
$(document).ready(function(){ 
    $("#rates").sortable(); 
}); 

</script> 
<% end %> 

當我看在控制檯我只是得到:

TypeError: $(...).sortable is not a function 

回答

0

我認爲應該是:

# app/assets/javascripts/application.js 
//= require jquery 
//= require jquery_ujs 
//= require turbolinks 
//= require jquery.ui.all 
//= require_tree .