2015-05-22から1日間の記事一覧
module AppHelper def icon(name) "<i class='icon-#{name}'></i>".html_safe end end # view <%= link_to "#{icon(:home)}家のリンク", "/home" %> iconヘルパーでhtml_safeしているのだけどlink_toで実行される頃には、別の文字列インスタントになっているのでタグがサニタイズされて表…
module AppHelper def icon(name) "<i class='icon-#{name}'></i>".html_safe end end # view <%= link_to "#{icon(:home)}家のリンク", "/home" %> iconヘルパーでhtml_safeしているのだけどlink_toで実行される頃には、別の文字列インスタントになっているのでタグがサニタイズされて表…