Search code examples
ruby-on-rails-3devisehaml

How to Generate Views for Devise in HAML


This is mine Gemfile

gem 'haml'
group :development do
  gem 'hpricot'
  gem 'ruby_parser'
end

I then executed the following statements in a terminal/command window:

bundle install
rails generate devise:views users -e haml

or

rails generate devise:views users -t = haml

But creating devise views in erb. how to fix this issue?


Solution

  • I have to do this

    rails generate devise:views
    
    gem "html2haml"
    bundle install
    
    for file in app/views/devise/**/*.erb; do html2haml -e $file ${file%erb}haml && rm $file; done
    

    and now it is perfect.

    Also see the devise wiki