Rails suddenly tries to display ERB instead of Haml, and I cannot understand why. I created new rail projects, reinstalled Haml, and reinstalled Rails.
Here are the exact steps that I take when creating my application (Rails 2.3.2):
rails> rails test
rails> cd test
rails\test> haml --rails .
rails\test> ruby script\generate model user email:string password:string
rails\test> ruby script\generate controller users index
rails\test> rake db:migrate
Here is what UserController looks like:
class UsersController < ApplicationController
def index
@users = User.all
end
end
My routes:
ActionController::Routing::Routes.draw do |map|
map.resources :users
end
Now I create views \ users \ index.html.haml:
%table
%th(style="text-align: left;")
%h1 Users
- for user in @users
%tr
%td= user.email
%td= user.password
Annnd start the server ... I go to localhost: 3000 \ users and I get this error message:
Template is missing
Missing template users/index.erb in view path app/views
For some reason, Rails is trying to find and display .erb files instead of .haml files. provider \ plugins \ haml \ init.rb exists, untouched.
I reinstalled Haml (Pretty Penny) several times and still get the same results. I also tried adding config.gem 'haml' to my .rb environment, but this also does not work.
, haml .