0

我已经生成了一个新的控制器 -

murtaza@murtaza-dev:~/workspace/rails/sim-sim$ rails g controller home index
          create  app/controllers/home_controller.rb
           route  get "home/index"
          invoke  haml
          create    app/views/home
          create    app/views/home/index.html.haml
          invoke  test_unit
          create    test/functional/home_controller_test.rb
          invoke  helper
          create    app/helpers/home_helper.rb
          invoke    test_unit
          create      test/unit/helpers/home_helper_test.rb
          invoke  assets
          invoke    coffee
          create      app/assets/javascripts/home.js.coffee
          invoke    scss
          create      app/assets/stylesheets/home.css.scss

但是,当我尝试在 localhost:3000/home/index 上访问它时,我的网页上出现以下错误 -

模板丢失

缺少带有 {:locale=>[:en], :formats=>[:html], :handlers=>[:erb, :builder, :coffee]} 的模板主页/索引、应用程序/索引。搜索:*“/home/murtaza/workspace/rails/sim-sim/app/views”

我该如何补救?

4

1 回答 1

0

可能您应该将“gem 'haml-rails'”添加到 Gemfile 开发组

像这样:

宝石文件

gem 'haml-rails', :group => :development
于 2012-07-25T09:28:12.377 回答