A reply from the mighty Christophe!
Thanks for this mate. That'll make it child's play for updating the
page with an array of active record objects.
All the best
Adam
On Apr 20, 11:04 am, Christophe Porteneuve <[EMAIL PROTECTED]> wrote:
> Hi Adam,
>
> addywaddy a écrit :
>
> > var groupTemplate = new Template('#{attributes.name} is administered
> > by #{users.attributes.first}');
>
> Currently Template only uses direct properties of the evaluated object:
> it doesn't go down. That's rather simple to fix, though. I'll consider
> a patch soon about this, in the meantime here's a working fix:
>
> evaluate: function(object) {
> return this.template.gsub(this.pattern, function(match) {
> var before = match[1];
> if (before == '\\') return match[2];
> // START OF FIX
> var obj = object;
> match[3].split('.').each(function(comp) {
> if (obj)
> obj = obj[comp];
> });
> return before + String.interpret(obj);
> // END OF FIX
> });
> }
>
> --
> Christophe Porteneuve aka TDD
> [EMAIL PROTECTED]
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Ruby
on Rails: Spinoffs" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/rubyonrails-spinoffs?hl=en
-~----------~----~----~----~------~----~------~--~---