|Mark Chadwick on 28 Feb 2007 16:26:53 -0000|
Erin Mulder wrote:
For the second half, I'd love to see someone give an "acts as *" talk
I recently wrote a acts_as_translatable plugin. It meshes well with Globalize (or similar). The idea is to have translatable fields on models where it doesn't really fit in to pre-translated strings. For example:
I have a product that asks users questions. The questions are in the DB, and users can make their own questions. I want the same questions to be asked to everyone, but I want it to be the the correct language, so:
class Question < AR::Base
acts_as_translatable [:title, :body]
And in the migration:
That way, when I have a Question, and I do <%= question.body %>, It's going to check with Globalize, see what the current language is, and display the correct translation.
Well. That was quite a spiel. Anyone want to see a presentation on that?
_______________________________________________ To unsubscribe or change your settings, visit: http://lists.phillyonrails.org/mailman/listinfo/talk