2
我正在使用rails版本3.2.12,併爲我的視圖使用.erb模板。application.html.haml未呈現
現在我想開始使用haml模板。
我將haml和haml-rails添加到gem文件並安裝了該軟件包。
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
當我運行此我得到以下錯誤消息: 使用{:locale => [:en],:formats => [:html],:handlers => [:erb,:builder,:coffee]}缺少模板佈局/應用程序。搜索:*「/ home/coen/Desktop/rails_project/sample_app/app/views」
好像haml處理程序沒有安裝。
我該如何做到這一點?
阿嘎,我討厭它什麼時候可以想到自己的答案:) 感謝一個捆綁隊友! – MPL 2013-03-17 22:52:30