0

我使用 gem 'zurb-foundation', '~> 4.0.0' 和 gem 'rails', '3.2.13'

在“捆绑安装”之后,我尝试生成标准基础布局模板(“rails g foundation:layout”),我看到“找不到生成器基础:布局。”

这是'rails generate --help'输出:



    Usage: rails generate GENERATOR [args] [options]

    General options:
      -h, [--help]     # Print generator's options and usage
      -p, [--pretend]  # Run but do not make any changes
      -f, [--force]    # Overwrite files that already exist
      -s, [--skip]     # Skip files that already exist
      -q, [--quiet]    # Suppress status output

    Please choose a generator below.

    Rails:
      assets
      controller
      generator
      helper
      integration_test
      mailer
      migration
      model
      observer
      performance_test
      resource
      scaffold
      scaffold_controller
      session_migration
      task

    Coffee:
      coffee:assets

    Foundation:
      foundation:install

    Jquery:
      jquery:install

    Js:
      js:assets

当我运行“rails g foundation:install”时,我有:



          insert  app/assets/javascripts/application.js
          append  app/assets/javascripts/application.js
        conflict  app/assets/stylesheets/foundation_and_overrides.scss
    Overwrite /Users/bmalets/Documents/ror_projects/easyprint/app/assets/stylesheets/foundation_and_overrides.scss? (enter "h" for help) [Ynaqdh] Yes
           force  app/assets/stylesheets/foundation_and_overrides.scss
          append  app/assets/stylesheets/foundation_and_overrides.scss
          append  app/assets/stylesheets/application.css
        conflict  app/views/layouts/application.html.erb
    Overwrite /Users/bmalets/Documents/ror_projects/easyprint/app/views/layouts/application.html.erb? (enter "h" for help) [Ynaqdh] Yes
           force  app/views/layouts/application.html.erb

在我有没有 vertical_menu 模板的空应用程序布局之后。我有没有顶部菜单的基础样式视图(只有 app/view/layouts/ 中的 application.html.erb )。问题是什么?为什么未加载 zurb/foundation 生成器?

4

1 回答 1

2

从 Foundation 4 开始,布局生成包含在foundation:install生成器中,在您的情况下,它实际上是可用的。赶紧跑 :

rails g foundation:install

您还可以查看生成器的实际源代码,以了解它的确切作用。

于 2013-06-10T12:09:58.580 回答