On 06/10/2007, Julian Tarkhanov <[EMAIL PROTECTED]> wrote:
>
>
> On 6-okt-2007, at 5:16, Piers Cawley wrote:
>
> > I kept ending up in an infinite
> > loop, which is no fun at all.
>
> It's OT, but it's a matter of overriding render in a controller that
> has to be themed by default.
>
> def render(*args)
>        return super(*args) if (args.any? && args.last.is_a?(Hash) &&
> args.last[:inline])
>        (args << {}) if args.empty? || !args[-1].is_a?(Hash)
>        args[-1][:themer] = @themer if @themer
>        super(*args)
> end
>
> Nevermind. I get that I'm a minority here, so I'll step aside and see
> what the more enlightened folks will come up with :-)
> will need hacking anyways.

I'm pretty sure that that's what I tried. The problem is that, some
way down the call chain, we end up calling render again without the
themer in the argument list, so it bounces up to the top level render,
which detects the absence of a themer and therefore inserts one, and
then it's off round the loop again.

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Core" 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-core?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to