Rails中的HTML实体link_to

use*_*143 4 ruby-on-rails link-to html-entities

如何在rails link_to中插入HTML实体?

例如✭会给你一个明星字符,如何在引号中插入?

例如,

<%= link_to " &#10029 Home", root_path %>
Run Code Online (Sandbox Code Playgroud)

谢谢!

web*_*ter 11

试试这个:

<%= link_to raw("&#10029 Home"), root_path %>
Run Code Online (Sandbox Code Playgroud)