jquery:install在Rails中不起作用 [英] jquery:install doesn't work in Rails

查看:94
本文介绍了jquery:install在Rails中不起作用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经在Rails 3.1应用程序中安装了gem jquery-rails.但是下面的行

I have installed gem jquery-rails in Rails 3.1 app. But line below

rails generate jquery:install --ui

获取错误:

Could not find generator jquery:install.

推荐答案

在Rails 3.1中,由于jquery是默认设置,因此您不再需要安装它,在app/assets/jquery/application.js和它看起来像:

In rails 3.1, because jquery is the default, you no longer need to install it, it will be required in app/assets/jquery/application.js and it will look something like:

//= require jquery
//= require jquery_ujs
//= require_tree .

您可以通过执行rails g来验证哪些生成器可用,而无需执行其他任何操作:

You can verify which generators are available by executing rails g without anything else:

rails g

这篇关于jquery:install在Rails中不起作用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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