【问题标题】:how to setup 'bootstrap tour' in Ruby on Rails如何在 Ruby on Rails 中设置“引导之旅”
【发布时间】:2016-10-17 09:37:53
【问题描述】:

我使用了 bootstrap-tour.min.css 和 bootstrap-tour.min.js

<script type="text/javascript" src='bootstrap-tour.min.js'></script>
<link rel="stylesheet" type="text/css" href="bootstrap-tour.min.css">

这是我的浏览页面

<form>
    <input id="one" value="one" />
    <input id="two" value="two" />
</form>

这是我的 js 文件

// Instance the tour
$(function () {
    var tour = new Tour();
    tour.addStep({
        element: "#one",
        title: "Step 1",
        content: "Content for step 1"
    });

    tour.addStep({
        element: "#two",
        title: "Step 1",
        content: "Content for step 1"
    });

    // Initialize the tour
    tour.init();

    // Start the tour
    tour.start();

});
// tour end

但仍然无法正常工作..任何人都可以帮助我:(!...

【问题讨论】:

标签: javascript css ruby-on-rails ruby twitter-bootstrap


【解决方案1】:

我要问一些问题,希望他们已经帮助你。

您收到什么错误消息(如果有的话?) 我认为 bootstrap-tour 依赖于 bootstrap,你设置了吗? 你有使用 application.js / application.css 吗?或者 application.css.scss 以防您使用 bootstrap-sass gem?

您使用的是 gem 'boostrap-tour-rails',还是包含纯 css?

【讨论】:

  • 感谢 kjell,我需要 application.css 和 application.js..现在我将尝试 bootstrap-tour-rails gem :)
  • 嗯... '需要两个 application.css...' 您的意思是您将它们包含在您的视图页面中吗?这不应该是必要的,rails 会为你做到这一点。
  • 别管它 kjell ..现在我使用了 'boostrap-tour-rails' gem..但是我有 application.scss ..当我添加 '*= require bootstrap-tour' 时,我得到了错误..就像一个'Sprockets::FileNotFound'
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2011-11-30
  • 1970-01-01
  • 1970-01-01
  • 2019-08-08
相关资源
最近更新 更多