Rails 3.1 升级主干,找不到 ujs 和 remotipart 文件
几周前我升级到了 Rails 3.1.3,并移动了一堆东西来使用主干。
大多数情况下,一切进展顺利,但我刚刚意识到rails-ujs.js 文件和remotipart.js 文件不在assets 目录中。
我在旧的 public/javascripts
文件夹以及其他地方寻找过它们,但没有找到它们。
我似乎也无法在 git 存储库中找到这些文件。有没有地方可以下载这些 Javascript 文件?或者它们需要由rails生成吗?有没有办法让它们再生呢?
---------------这可能是我的错误----------------------------
我只是意识到打包资产后,您不能只从查看源代码打开文件,它们都显示为不存在。
I upgraded to rails 3.1.3 a few weeks ago, and moved a bunch of stuff around to use backbone.
Mostly, things are going well, but I just realized that the rails-ujs.js file and remotipart.js files are not in the assets directory.
I've looked for them in the old public/javascripts
folder, as well as everywhere else, but no luck finding them.
I also can't seem to find the files in the git repos. Is there somewhere to download these files in Javascript? or do they need to be generated by rails? Is there a way to regenerate them?
---------------this could be my error ----------------------------
I just realized that with the assets packed, you can't just open a file from view source, they all show as non-existent.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我认为这些文件位于 asset 目录中的 Rails ujs 插件中。因此您需要将其添加到 Gemfile 中,并且资产管道应该会自动看到它们。
所有文件都在这里 https://github.com/rails/jquery-ujs/tree/ master/src 可包含在您的 js 文件中,
参见插件自述文件了解更多信息信息
I think theses files lived in the rails ujs plugins in asset directory. so you need to add it to your Gemfile and the asset pipeline should see them automaticaly.
all files here https://github.com/rails/jquery-ujs/tree/master/src are available to include in your js file with
see plugin readme for more informations
您需要将其包含在您的 Gemfile 中:
这是此代码的官方插件。
运行捆绑安装。
然后将以下行添加
到 application.js 文件中。
You need to include this in your Gemfile:
That is the official plugin for this code.
Run bundle install.
Then you add the lines:
to you application.js file.