Forum: Rails I18n rails3 model attributes and html

Announcement (2017-05-07): is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see and for other Rails- und Ruby-related community platforms.
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

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. => "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 <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,

This topic is locked and can not be replied to.