Ruby on Rails / Rubygems / FullStack / Git / Mac notes.
Rails Scaffold Create .erb Rather Thean .haml After Bundling Rails-haml Gem
After bundling ‘rails-haml’ gem, all views generated by scaffold are .haml. If we want to use default .erb views file, we need to append the folowing lines in your config/application.rb file or in config/enviroments/developement.rb.
123456789101112131415
# application.rb...moduleEventsclassApplication<Rails::Application....# append to hereconfig.generatorsdo|g|g.template_engine:erbend....endend...
or
12345678910111213
# developement.rbEvents::Application.configuredo# Settings specified here will take precedence over those in config/application.rb.........config.generatorsdo|g|g.template_engine:erb# or :haml if you prefer .hamlend........# Raises error for missing translations# config.action_view.raise_on_missing_translations = trueend