Generating Sass and Haml in Rails
Does the current head of Rails not come with haml generators? (I know in Rails 2 you had to add a generator plugin.) Setting con开发者_StackOverflow中文版fig.generators.template_engine = :haml doesn't work. Also, how do I switch from generating .scss to generating .sass? Setting config.generators.template_engine = :sass didn't work. I get error haml/sass [not found]. I have both installed and in my Gemfile.
In 3.0, there is no haml nor sass/scss support, you need to place them in your gemfile, and call bundler. But you will get no generators even with these gems, you should use something with theese if you realy want that.
And with rails 3.1, sass/scss is part of the framework.
I'm not sure about Sass (although I'd recommend using scss over sass files) - but with Haml, all you need to do is have the haml gem listed in your Gemfile, and have haml
instead of erb
in your view file names. For example: index.html.haml
- and that should just work.
精彩评论