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.

erb拡張子をhaml拡張子に変更する

Last updated at Posted at 2020-02-21

※初心者向け
※アウトプット練習の為、記述しております。

今回は拡張子の変換について記述しております。

開発環境
rails 5.2.4.1
ruby 2.5.1

やりたい事下記のファイルの拡張子(.erb)をファイルの内容も含め全てhamlへ変換したい。

 /view/_form.html.erb
      /item.html.erb
      /new.html.erb   

まずはGemファイルに記述 

 gem 'erb2haml'

ターミナル

 bundle install
 rails haml:erb2haml

実行結果拡張子

 /view/_form.html.haml
      /item.html.haml
      /new.html.haml

以上で変換完了です

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?