HAML

Add beautifully DRY, well-indented, clear markup.
Icons/chart bar
Used 179 times
Created by
I Ivan Raszl

Usage
Once the script has run, all view files with the ".html.haml" extension will be compiled using Haml. The script will ask if you want to convert your existing *.erb files to *.haml files, and whether you want to keep the original *.erb files or not. Read more about HAML.

Run this command in your Rails app directory in the terminal:

rails app:template LOCATION="https://railsbytes.com/script/x7msKK"
Template Source

Review the code before running this template on your machine.

run "bundle add haml"
run "bundle install"
if yes?("Would you like to convert your existing *.erb files to *.haml files? [y/n]")
  run "bundle add erb2haml --group 'development'"
  run "bundle install"
  if yes?("Would you like to keep the original *.erb files? [y/n]")
    rake "haml:convert_erbs"
  else
    rake "haml:replace_erbs"
  end
end
Comments

Sign up or Login to leave a comment.