【问题标题】:How to edit the bootstrap.js file of gem twitter-bootstrap-rails如何编辑 gem twitter-bootstrap-rails 的 bootstrap.js 文件
【发布时间】:2014-03-20 18:07:02
【问题描述】:

我知道这肯定是错误的,但我似乎无法让子菜单链接在移动设备上工作,other posts 建议编辑 bootstrap.min.js 文件。

但是,由于我使用的是 gem“twitter-bootstrap-rails”,我不知道文件在哪里,即使它可以改变它。

想法?

这是我的代码,省略了一些部分。

<%= nav_bar :fixed => :top, :brand => image_tag('logo.png'), :responsive => true do %>
    <% if user_signed_in? %>
        <%= menu_group :pull => :right do %>
            <%= drop_down "Scan" do %>
                <%= menu_item "Android", 'http://sasfad' %>
                <%= menu_item "iPhone", 'zxing://asfasdf' %>
            <% end %>
        <% end %>
    <% end %>

【问题讨论】:

    标签: ruby-on-rails twitter-bootstrap


    【解决方案1】:

    您不能也不应该编辑这些文件。但是您可以分叉 gem,编辑 bootstrap.min.js 文件并在 Gemfile 中使用分叉的 gem。

    我的建议是不要使用 twitter-bootstrap-rails gem,因为它唯一的作用就是为您将资产添加到资产管道中。

    【讨论】:

    • 它不是唯一的。它生成完全可由 i18n 翻译的 twitter 引导视图。我会做一个叉子并在 Gemfile 上使用你的分支。
    • 我对 i18n 并不是很感兴趣,但是(不是说它现在对我有那么大的影响)我希望能够使用 Less。我可以在没有 gem 的情况下使用它(没有复杂性)吗?此外,如果我放弃它,我可以简单地从我的 gemfile 中删除该行吗?谢谢大家!
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2012-05-31
    • 2012-02-25
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多