MPL
MPL

Reputation: 396

application.html.haml not rendered

I am using rails version 3.2.12 and was using .erb templates for my view.

Now I want to start using haml templates.

I added haml and haml-rails to the gem file and installed the bundle.

Using haml (4.0.0) 
Installing haml-rails (0.4) 

I have made a mock-up application.html.haml

!!! 5
%html
  %head
    %title Rotten Potatoes!
    = stylesheet_link_tag 'application'
    = javascript_include_tag 'application'
    = csrf_meta_tags

  %body
    = yield

I then changed the application_controller.rb to

class ApplicationController < ActionController::Base
  layout "application"
  protect_from_forgery
  include SessionsHelper
end

when I run this I get the following error message: Missing template layouts/application with {:locale=>[:en], :formats=>[:html], :handlers=>[:erb, :builder, :coffee]}. Searched in: * "/home/coen/Desktop/rails_project/sample_app/app/views"

it seems as if the haml handler not installed.

How can I accomplish this?

Upvotes: 2

Views: 1785

Answers (1)

Konrad Szczęśniak
Konrad Szczęśniak

Reputation: 1970

Well, have you restarted your development server? It is very important thing to do after adding a gem to Gemfile.

BTW. I use haml all the time, i haven't ever used 'haml-rails'.

When i start fresh project, the only thing i do is add "gem 'haml'" to Gemfile and everything works just like it supposed to work.

Upvotes: 2

Related Questions