我是 Ruby 的新手,正在做我的第一个项目。这是我正在使用的版本...
- 红宝石 2.1.1p76
- 导轨 4.1.0
我无法添加我的 JavaScript 文件。我正在关注这篇文章(特别是站点范围的脚本部分) 阅读完文章后,我将vendor/assets/javascripts和我自己的脚本保存jquery.js & jquery.validate.min.js
在app/assets/javascripts/additionalJS目录下accRefConfig.js
所以这是我的app/assets/javascripts/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, vendor/assets/javascripts,
// or vendor/assets/javascripts of plugins, if any, 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.
//
// Read Sprockets README (https://github.com/sstephenson/sprockets#sprockets-directives) for details about supported directives.
//
// = require jquery
// = require jquery.validate.min
// = require_tree ./additionalJS
和我的应用程序布局......
<head>
<title>Hello World</title>
<%= stylesheet_link_tag "application.css", media: "all", "data-turbolinks-track" => true %>
<%= javascript_include_tag "application" %>
</head>
但这给了我以下错误....
我究竟做错了什么?提前感谢您的时间和帮助:)
顺便说一句,我也试过了<%= javascript_include_tag "application.js" %>
,但同样的错误消息