概要 原著者の許諾を得て翻訳・公開いたします。 英語記事: Learn how to use advanced options for content_tag helper in Rails app -- 現在はリンク切れです 原文公開日: 2018/02/04 著者: Paweł Dąbrowski 2018/04/10: 初版公開 2022/11/24: 更新 追記(2022/11/24) content_tagは現在はレガシ記法とされており、それに代わってtagメソッドの利用が推奨されています。本記事で紹介されているcontent_tagメソッドのclass:オプションやescape:オプションもtagメソッドで利用できます。 参考: Rails API tag -- ActionView::Helpers::TagHelper また、tag('dev')のようなレガシ記法ではなく、
![Rails tips: ビューのcontent_tagのあまり知られていないオプション(翻訳)|TechRacho by BPS株式会社](https://cdn-ak-scissors.b.st-hatena.com/image/square/dfff9c8909932d194d44306453ab9cea8178fd18/height=288;version=1;width=512/https%3A%2F%2Ftechracho.bpsinc.jp%2Fwp-content%2Fuploads%2F2018%2F04%2Frails_tips_content_tag_eyecatch-min.png)