0
1

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.

slim内に変数を埋め込むメモ

Posted at

railsの変数を埋め込むメモ

- media_type = request.host.split('.')[0]

- content_for :title do
  | テスト

- content_for :page_class do
  | テスト

- content_for :head_tags do
  //端折る

div class="#{media_type}" //ここ

とあるrailsのプロジェクトで媒体ごとにclassを振り分けたかった時があったのでメモ
※(ワードプレスの各ページでclassがつくイメージ)

まとめ

個人的メモ
忘れそうだったので記述した

0
1
1

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
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?