On 06/10/2007, Julian Tarkhanov <[EMAIL PROTECTED]> wrote:
>
>
> On 5-okt-2007, at 23:19, Mislav Marohnić wrote:
>
> > View path array is very useful in the current state
>
> I wonder in which ways it is superior to the template_root that was
> there before?
> It does not properly work with inheritance (you need the same
> workarounds as with before_ and after_filter,
> because managing an inherited array is nasty), it is classlevel, it
> does not couple to ActionMailer, it does not solve the problems
> in ActionView. Basically the only thing it _does_ permit is making a
> kind-of-working overlay stack for template lookups (purposedly for
> plugins as I've read on the changesets), once per class definition in
> the code. For the rest of us it makes life much more difficult.
Depends what you mean by difficult. In order to get Typo's themes
working with Rails 2.0, I ended up doing:
@@view_paths[self.class.name] =
[path_to_theme] +
@@view_paths["ActionController::Base"]
in a before filter and it worked like a charm.
Obviously, I expect it'll get broken in subsequent Rails releases, but
it turned out to be a great deal easier to do it this way than it did
to work out how to use the themer plugin, which works fine until you
try and work out some way of not having to pass in an explicit :themer
argument to every call to render - I kept ending up in an infinite
loop, which is no fun at all.
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---