How do I get Haml to work with Rails?

后端 未结 10 1119
一向
一向 2020-12-07 13:15

I am trying to get Haml to work with my Ruby on Rails project. I am new to Ruby on Rails and I really like it. However, when I attempt to add an aplication.html.haml

10条回答
  •  失恋的感觉
    2020-12-07 13:42

    First, install haml as a gem in bundler by adding this to your Gemfile:

    gem "haml"
    

    Run bundle install, then make sure your views are named with a *.html.haml extension. For example:

    `-- app
        `-- views
            |-- layouts
            |   `-- application.html.haml
            `-- users
                |-- edit.html.haml
                |-- index.html.haml
                |-- new.html.haml
                `-- show.html.haml
    

提交回复
热议问题