12

@post.content、欲しい

1.simple_format であるため、コンテンツは改行なしの 1 行ではなく、複数の行で表示されます。

2.html_safe、ユーザーはyoutube の<embed>ようなビデオ リンクを貼り付けることができます

分けて使っ<%= simple_format @post.content %>てもOK<%= @post.content.html_safe %>

しかし、それらを一緒に使用すると<%= simple_format @post.content.html_safe %>、 html_safe が機能しないため、<embed>ビデオが表示されません

<embed>コードをsimple_format同時に有効にする方法を教えてください。または表示する他のソリューションはあり@post.contentますか?ありがとう!!!

4

2 に答える 2