zurb_foundation layout generation in rails

≯℡__Kan透↙ 提交于 2019-12-13 07:02:01

问题


I use gem 'zurb-foundation', '~> 4.0.0' and gem 'rails', '3.2.13'

After 'bundle install', I try to generate standart foundation layout templates ( 'rails g foundation:layout' ), I see 'Could not find generator foundation:layout.'

This is 'rails generate --help' output:



    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

Whe I run 'rails g foundation:install', I have:



          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

After I have empty application layout without vertical_menu template. I have views with foundation style without top menu ( only application.html.erb in app/view/layouts/ ). What is the problem? Why zurb/foundation generators that are not loaded?


回答1:


As of Foundation 4, the layout generation is included in the foundation:install generator, which, in your case, is actually available. Just run :

rails g foundation:install

You might also take a peek at the actual source code of the generator to see exactly what it does.



来源:https://stackoverflow.com/questions/17014425/zurb-foundation-layout-generation-in-rails

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!