Mark Chadwick on 28 Feb 2007 16:26:53 -0000

[Date Prev] [Date Next] [Thread Prev] [Thread Next] [Date Index] [Thread Index]

Re: [PhillyOnRails] Thanks! And topic idea.

Erin Mulder wrote:
For the second half, I'd love to see someone give an "acts as *" talk
and give a tour of many the most popular acts-as plugins out there (e.g.
paranoid, versioned, taggable, etc).  Any volunteers for that, or ideas
on alternative topics?

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: