Rails バージョン 3.2.12 を使用しており、ビューに .erb テンプレートを使用していました。
ここで、haml テンプレートの使用を開始したいと思います。
gemファイルにhamlとhaml-railsを追加し、バンドルをインストールしました。
Using haml (4.0.0)
Installing haml-rails (0.4)
モックアップ application.html.haml を作成しました
!!! 5
%html
%head
%title Rotten Potatoes!
= stylesheet_link_tag 'application'
= javascript_include_tag 'application'
= csrf_meta_tags
%body
= yield
次に、application_controller.rb を次のように変更しました。
class ApplicationController < ActionController::Base
layout "application"
protect_from_forgery
include SessionsHelper
end
これを実行すると、次のエラー メッセージが表示されます: Missing template layouts/application with {:locale=>[:en], :formats=>[:html], :handlers=>[:erb, :builder, :coffee] }。検索場所: * 「/home/coen/Desktop/rails_project/sample_app/app/views」
haml ハンドラーがインストールされていないようです。
どうすればこれを達成できますか?