0
3

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.

【ruby on rails】formにおいて、text_areaに入力した改行をそのまま表示する方法

Posted at

text_areaで入力された文章を

<%= @user.comment %>

みたいな感じで表示されたら、改行が表現されなかったので、調べました。

どうやらsimple_formatなるメソッドを使えばいいようなので

<%= simple_format(@user.comment) %>

に変更。

0
3
2

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
3

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?