我已经生成了一个新的控制器 -
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”
我该如何解决它?
答案 0 :(得分:0)
可能应该在Gemfile开发组中添加“gem'haml-rails'”
像这样:<强>的Gemfile 强>
gem 'haml-rails', :group => :development