0
0

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 3 years have passed since last update.

RailsにてerbファイルをHamlに変換する方法

Posted at

備忘録としてerbファイルをHamlに変換する方法をまとめました。
手順は下記の通りです。

#1.Gemfileにgem 'haml-rails'を記述

gem 'haml-rails'

#2.bundle installをする
記述後、bundle installをする

#3.拡張子がerbのファイルをhamlに変換

$ rails haml:erb2haml

コマンドを実行すると...

--------------------------------------------------------------------------------
Generating HAML for app/views/home/top.html.erb...
Generating HAML for app/views/home/about.html.erb...
Generating HAML for app/views/layouts/application.html.erb...
Generating HAML for app/views/layouts/mailer.html.erb...
Generating HAML for app/views/layouts/mailer.text.erb...
--------------------------------------------------------------------------------
HAML generated for the following files:
	app/views/home/top.html.erb
	app/views/home/about.html.erb
	app/views/layouts/application.html.erb
	app/views/layouts/mailer.html.erb
	app/views/layouts/mailer.text.erb
--------------------------------------------------------------------------------
Would you like to delete the original .erb files? (This is not recommended unless you are under version control.) (y/n)
y
Deleting original .erb files.

変換完了です!

0
0
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
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?