0

我已经在我的 gem 文件中包含了我的引导 gem,并且 css 代码似乎工作正常。但是现在我正在尝试实现一个下拉菜单,$('.dropdown-toggle').dropdown() 但我被告知我需要从引导程序下载另一个 *.js 文件。它们不都包含在宝石中吗?是否有教程可以告诉我如何使用 RoR 中的下拉菜单?

编辑:

// This is a manifest file that'll be compiled into application.js, which will include all the files
// listed below.
//
// Any JavaScript/Coffee file within this directory, lib/assets/javascripts, vendor/assets/javascripts,
// or vendor/assets/javascripts of plugins, if any, can be referenced here using a relative path.
//
// It's not advisable to add code directly here, but if you do, it'll appear at the bottom of the
// the compiled file.
//
// WARNING: THE FIRST BLANK LINE MARKS THE END OF WHAT'S TO BE PROCESSED, ANY BLANK LINE SHOULD
// GO AFTER THE REQUIRES BELOW.
//
//= require jquery
//= require jquery_ujs
//= require twitter/bootstrap
//= require_tree .
4

1 回答 1

0

查看 twitter-bootstrap-rails,它有可以为您进行设置的生成器。github 页面上的自述文件包含所有说明,还有一个指向 railscast 的链接,其中有两个视频解释了该做什么。

https://github.com/seyhunak/twitter-bootstrap-rails

于 2017-01-03T18:22:27.843 回答