【发布时间】:2017-09-16 00:42:47
【问题描述】:
我刚刚为我的 Ruby on Rails 应用程序安装了 jQuery UI。它运行 Rails 5。我查看了所有类似的帖子,但它们不适用于我的情况。
我的页面渲染得很好,但是在 Chrome 开发工具控制台中,我收到了这个错误:
我以各种方式重新排列了 application.js 文件,但仍然出现相同的错误。这是文件:
// This is a manifest file that'll be compiled into application.js, which will include all the files
// listed below.
//
// Any JavaScript/Coffee file within this directory, lib/assets/javascripts, or any plugin's
// vendor/assets/javascripts directory can be referenced here using a relative path.
//
// It's not advisable to add code directly here, but if you do, it'll appear at the bottom of the
// compiled file. JavaScript code in this file should be added after the last require_* statement.
//
// Read Sprockets README (https://github.com/rails/sprockets#sprockets-directives) for details
// about supported directives.
//
//= require jquery-ui
//= require rails-ujs
//= require html.sortable
//= require turbolinks
//= require_tree .
//= require popper
//= require bootstrap-sprockets
【问题讨论】:
-
如果你把
//= require jquery放在其他请求之前呢? -
@maxpleaner 是的,这就是原因
标签: javascript jquery ruby-on-rails ruby