[Rails] Re: Rails 3: finding a record by name in multilingual app
Well, I have been using Page.find_by_name("Welcome") in my code all the
time when I was on Rails 2 (and globalize2, of course) and no matter
what language was selected by the user it was always possible to load
the welcome page with this command: Page.find_by_name("Welcome")
Eversince I switched to Rails 3 Page.find_by_name("Welcome") doesn't
work anymore if there's another language selected but English which
sucks cause I'd need to wrap an if clause checking for the language and
then do one of these:
Page.find_by_name("Welcome") for English
Page.find_by_name("Willkommen") for German
Page.find_by_name("Bienvenido") for Spanish
which is very stupid but I hope you're catching my drift.
The problem is that I can't use the id but have to use the name which is
multilingual.
--
Posted via http://www.ruby-forum.com/.
--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.

0 Comments:
Post a Comment
Subscribe to Post Comments [Atom]
<< Home