Why not login to Qiita and try out its useful features?

We'll deliver articles that match you.

You can read useful information later.

7
4

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.

Railsのerbをslimに変更する方法

Last updated at Posted at 2019-08-06

はじめに

この記事では、自身の備忘録も兼ねてrailsのデフォルトで使用しているテンプレートエンジンであるERBからSlimに変更する方法を記載していきます。

準備

Gemfileにslim-railsとhtml2slimを追加します。

Gemfile
gem 'slim-rails'
gem 'html2slim'

bundleを実行し、gemをインストールします。

$ bundle 

erbを削除し、slimに変更する

$ bundle exec erb2slim app/views/layouts/ --delete

このような手順でerbをslimに変更できます。

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

Qiita Conference 2025 will be held!: 4/23(wed) - 4/25(Fri)

Qiita Conference is the largest tech conference in Qiita!

Keynote Speaker

ymrl、Masanobu Naruse, Takeshi Kano, Junichi Ito, uhyo, Hiroshi Tokumaru, MinoDriven, Minorun, Hiroyuki Sakuraba, tenntenn, drken, konifar

View event details
7
4

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?