mkk
mkk

Reputation: 7693

Cannot find application.html.haml in a new Rails 3 app

I want to create Rails 3 app just to update myself, but I have strange issue.

I have created welcome#index action using

rails generate controller welcome#index

(I have haml-rails gem) and I observe that a new view index.html.haml has been created. This action is my root_path, so in localhost:3000 I get content of this view.

I had application.html.erb which I have changed manually to application.html.haml and I have added layout 'application' in ApplicationController, but I get

Template is missing

Missing template layouts/application with {:locale=>[:en], :formats=>[:html], :handlers=>[:erb, :builder, :coffee, :haml]}

now, any ideas why ?

Maybe some code snippets:

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

the file is in place:

mkk:~/projects/rails/gifts/app/views/layouts$ ls
application.html.html

Upvotes: 0

Views: 331

Answers (1)

Buck Doyle
Buck Doyle

Reputation: 6397

Your ls shows the layout file is called application.html.html, change it to application.html.haml.

Upvotes: 1

Related Questions