4
2

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

Haml 導入

Last updated at Posted at 2019-04-03

hamlの導入方法

hamlに必要なgemを追加

Gemfile
gem 'haml-rails'
gem 'erb2haml'
ターミナル
$hogehoge[アプリケーション名] bundle install

.erb を hamlに変える方法

ターミナル
$hogehoge[アプリケーション名] rake haml:replace_erbs

こちらのコマンドを打つことによって

hogehoge.erb
<div class="hogehoge">
  <div class="hogehoge__text">
    <p>
      hogehoge
    </p>
  </div>
</div>

から

hogehoge.haml
.hogehoge
  .hogehoge__text
    %p
      hogehoge

のように変更されます!

4
2
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
4
2

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?