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.

【Ruby】<%= %>内でstyle要素を書く方法

Posted at

こんにちは!テックアカデミーのWebアプリコースを受講している駆け出し高校生エンジニアの安田駿介です。

今回は、「Ruby <%= %>内でstyle要素を書く方法」というテーマで解説していきます。

#誤った書き方

097f29a41aed890a26dc39803fa42f2f.png

このような書き方だと、エラーになってしまうはずです。

#正しい書き方
85bbc78926158bb6f935b36ac0c654a0.png

style要素に注目すると、=ではなく、:を使っています。

#開発環境
・Cloud9
・Ruby 3.0.0
・Rails 6.1.3.1

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