为什么"jQuery-Rails"经常不在资产组之外 [英] Why is 'jQuery-Rails' often outside of the asset group
问题描述
为什么我经常在:assets
组之外看到gem 'jquery-rails
?
Why is it that I often see gem 'jquery-rails
outside of the :assets
group?
group :assets do
gem 'sass-rails', " ~> 3.1.0"
gem 'coffee-rails', " ~> 3.1.0"
gem 'uglifier'
end
gem 'jquery-rails'
如果我将其放入车内,会不会出现儿童车行为?
Will there be buggy behavior if I put it inside?
谢谢!
推荐答案
jquery-rails
gem还提供了一些测试助手.因此,也许出于这个原因,人们更喜欢将其放在:assets
组之外.
The jquery-rails
gem provides some test helpers also. So perhaps for that reason people prefer to put it outside the :assets
group.
但是,:assets
组包含在开发和测试环境中,因此,如果您愿意的话,将jquery-rails
放在:assets
组中应该是绝对安全的.
However, the :assets
group is included in development and testing environment, so you should be perfectly safe to place jquery-rails
in your :assets
group if you like.
只需确保在部署应用程序之前预先编译资产.
Just make sure you precompile your assets before you deploy your application.
这篇关于为什么"jQuery-Rails"经常不在资产组之外的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!