Well it's certainly true in practice because of exactly what you say,
ActionView::Base is initialized early.  However all that would be
necessary for it to work is to reference the canonical view_paths from
ActionController.

I know it's kind of a dangerous feature because if people add paths
without removing them, the controller would get slower and slower, but
it enables a whole new realm of functionality that I desperately need.

On 6/5/07, Trevor Squires <[EMAIL PROTECTED]> wrote:
> I could be wrong but I seem to recall that you can't set view_paths on
> a per-request basis (this may also be an old limitation that's been
> changed/removed).
>
> I recall that when I looked at it I concluded that the view class was
> being set-up before before_filters fire.
>
> Sorry I can't be more specific - hopefully it's not a red herring.
>
> Trevor
>
> On 6/5/07, Mislav Marohnić <[EMAIL PROTECTED]> wrote:
> > I, for one, am not sure what kind of behavior are you trying to describe.
> > Can you pastie us some code?
> >
> > It may be useful for you if you observed and played with unit tests for
> > this:
> > action_pack/test/controller/view_paths_test.rb
> >
> > You can try and make a failing tests from you observations.
> >
> > -M
> >
> >
> > On 6/5/07, dasil003 <[EMAIL PROTECTED]> wrote:
> >
> > >
> > > * ActionController::Base.view_paths is being set correctly up front in
> > > an around_filter before the action executes.
> > > * AcionView::Base.find_base_path_for does not immediately pick up this
> > > change even though it was made earlier in the execution.  Both the
> > > layout and the template are 'found' using the default path during the
> > > first dozen executions of this method (while it's searching different
> > > extensions).
> > > * When the actual render is performed (ie. after the logger output
> > > render content/index is printed) the template is located from the
> > > default path as well, but when it searches for layouts/application,
> > > suddenly the full paths I specified up front are used and it finds the
> > > correct template.
> > >
> > > I'm a little rough on the whole rendering flow, so I'm hoping someone
> > > can point me in the right direction with a quick insight.
> > >
> > >
> > >
> > >
> > >
> >
> >
> >  >
> >
>
>
> --
> --
> Trevor Squires
> http://somethinglearned.com
>
> >
>


-- 
Gabe da Silveira
http://darwinweb.net

--~--~---------~--~----~------------~-------~--~----~
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