Rails 4-如何安装"jquery-ui"? [英] Rails 4 - how to install "jquery-ui"?
本文介绍了Rails 4-如何安装"jquery-ui"?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
要使用jquery自动完成插件,我需要安装 jquery-ui gem.
For using jquery autocomplete plugin, I need to install jquery-ui gem.
到目前为止,我在我的gemfile中包含以下内容:
So far, I had in my gemfile following:
gem 'jquery-rails'
所以我添加了:
gem 'jquery-ui-rails'
向application.js
添加:
//= require jquery
//= require jquery_ujs
//= require jquery-ui
和application.css
:
*= require_self
*= require jquery.ui
bundle update
,重新启动服务器,然后:
bundle update
, restart server and:
couldn't find file 'jquery.ui'
我也在turbolinks
应用程序中使用.为了让 jquery-ui 在应用中正常工作,我会错过某件事吗?
I am using in the app also turbolinks
. Do I miss a gem something or something in order to make jquery-ui work in the app?
谢谢.
Gemfile中与jquery有关的所有内容:
All jquery-related stuff in tehe Gemfile:
gem 'jquery-rails'
gem 'jquery-ui-rails'
gem 'jquery-turbolinks'
推荐答案
在application.css
中应该是
*= require jquery-ui
这篇关于Rails 4-如何安装"jquery-ui"?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文