【问题标题】:rails generate bootstrap layout with bootstrap-sass instead of twitter-bootstrap-railsrails 使用 bootstrap-sass 而不是 twitter-bootstrap-rails 生成引导布局
【发布时间】:2013-08-05 17:03:03
【问题描述】:

我必须从bootstrap-sass 和twitter-bootstrap-rails 中进行选择,并且我根据网络上的建议选择了第一个。

但是,我看到twitter-bootstrap-rails gem 有一些用于应用程序布局的生成器。喜欢,

rails g bootstrap:layout application fixed
rails g bootstrap:themed Posts

我发现这对于启动项目非常有用。但我在bootstrap-sass gem 中找不到类似的生成器。运行命令:

rails generate 

没有像以前那样显示任何生成器。

有没有办法让这些布局使用bootstrap-sass 而不是twitter-bootstrap-rails?

提前致谢。

【问题讨论】:

    标签: ruby-on-rails ruby-on-rails-3 twitter-bootstrap-rails bootstrap-sass


    【解决方案1】:

    在那里你可以找到一种为 bootstrap-sass 生成主题的好方法:

    https://github.com/doabit/bootstrap-sass-extras

    基本上你只是:

     rails g scaffold Post title:string description:text
     rake db:migrate
     rails g bootstrap:themed Posts
    

    【讨论】:

      【解决方案2】:

      我正在使用这个 gem,虽然我不知道它的生成器。

      我在 GitHub 上找到了一个你可能会觉得有用的 gem:

      https://github.com/decioferreira/bootstrap-generators

      或者,您可以简单地定义一个新的 custom.css.scss 文件并开始使用整个应用程序的 css。并且不要忘记将引导导入添加到您的文件中!

      【讨论】:

        【解决方案3】:

        还有这些(鲜为人知但可能值得一试)宝石:

        https://github.com/thrivesmart/bootscaf

        https://github.com/leandroo/flexi_generators

        【讨论】:

          猜你喜欢
          • 1970-01-01
          • 1970-01-01
          • 2012-11-09
          • 2012-04-27
          • 1970-01-01
          • 2013-09-26
          • 1970-01-01
          • 2023-03-20
          • 2013-05-29
          相关资源
          最近更新 更多