Qiita Teams that are logged in
You are not logged in to any team

Log in to Qiita Team
Community
OrganizationAdvent CalendarQiitadon (β)
Service
Qiita JobsQiita ZineQiita Blog
0
Help us understand the problem. What is going on with this article?
@y-ikeda0204

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

More than 1 year has passed since last update.

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

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

開発環境
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
Help us understand the problem. What is going on with this article?
Why not register and get more from Qiita?
  1. We will deliver articles that match you
    By following users and tags, you can catch up information on technical fields that you are interested in as a whole
  2. you can read useful information later efficiently
    By "stocking" the articles you like, you can search right away
y-ikeda0204
駆け出しエンジニアです。 プログラミングスクールで学んだ内容をアウトプットする為記述しております。 よろしくお願い致します。

Comments

No comments
Sign up for free and join this conversation.
Sign Up
If you already have a Qiita account Login
0
Help us understand the problem. What is going on with this article?