Forum: Rails I18n Generic Tranlation for controllers

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.
85458feac00c538a9689d43ee0f3c8d6?d=identicon&s=25 Tomas R. (josetomas_r)
on 2011-01-06 22:47
I need something to translate

format.html { redirect_to(@news, :notice => 'News was successfully
created.') }

This --> 'News was successfully created.'

so I make

controller_created: "%{model} was successfully created"

For using it on every controller, but on the browser Im getting

%{model} was successfully created, so %{model} isn't replaced by the
model name, Is there a way of doing this?
sven (Guest)
on 2011-01-07 12:24
(Received via mailing list)
I'm not 100% sure, but I think you have to close the ->"" and add %
(model).name.to_s or %(model).to_s !!
This topic is locked and can not be replied to.