Forum: Rails I18n rails3 model attributes and html

Ce6a87158ef16a2b0b114cff234edb9d?d=identicon&s=25 Stijnster (Guest)
on 2010-10-08 10:18
(Received via mailing list)
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>*</
span>"


when i put the following on a form;

<%= f.label :name %>


it returns the following error;

"translation data {:html=>"Titel van jou job <span>*</span>"} 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
This topic is locked and can not be replied to.