为什么"jQuery-Rails"经常不在资产组之外 [英] Why is 'jQuery-Rails' often outside of the asset group

查看:69
本文介绍了为什么"jQuery-Rails"经常不在资产组之外的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

为什么我经常在: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屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆