# Rails3 model attributes and html

**URL:** <https://www.ruby-forum.com/t/rails3-model-attributes-and-html/196188>\
**Category:** Rails I18n\
**Created:** [October 8, 2010, 10:18am UTC](https://www.ruby-forum.com/t/rails3-model-attributes-and-html/196188 "2010-10-08T10:18:35Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Stijnster](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/8e7dd6/32.png) [@Stijnster](https://www.ruby-forum.com/u/Stijnster)\
**Post date:** [October 8, 2010, 10:18am UTC](https://www.ruby-forum.com/t/rails3-model-attributes-and-html/196188/1 "2010-10-08T10:18:35Z")

</div>

Hi all,

in Rails3 you have label support for activerecord model attributes by  
default.

Since Rails3 defaults to “no-html-safe” strings, you need to  
append .html to your key in order to process it as html. This however  
does not seem to work for activerecord model attributes. E.g.

activerecord.attributes.job.name.html =\> “Titel van jou job \*\</  
span\>”

when i put the following on a form;

\<%= f.label :name %\>

it returns the following error;

“translation data {:html=\>“Titel van jou job \*”} can not  
be used with :count =\> 1”

Leaving the .html returns the string but in a non-html-safe way.

Is there a workaround for this?

Best regards,

Stijn
