kinet
kinet

Reputation: 1780

How do I use Unicode in a button (rails form_for)?

<%= f.button "Vote &#9650;" %>

I'm trying to print text + a Unicode triangle. Can't find the syntax. Thanks!

Upvotes: 3

Views: 406

Answers (1)

Ryan Bigg
Ryan Bigg

Reputation: 107728

By default, strings output in Rails views are automatically escaped.

You will need to stop it from escaping it by telling Rails that the string is HTML safe:

 "Vote &#9650;".html_safe

Upvotes: 3

Related Questions