My use case is an app that is fully customizable to client's needs by overriding any of the templates, still able to use default templates (ie. Rails 1.2.3 view_root is insufficient, I had been using theme_support plugin, but it was a nasty hack) . The search path is set per request based on the domain that fielded the request.
I thought my explanation was pretty thorough, although maybe all the details are confusing things, and the fact that layouts happen to work is tangential (although it's a big part of my confusion) The essential problem is this: ActionView::Base is initialized early on in the request cycle with the view_paths that exist at the time. If they are set by a plugin during initialization as is demonstrated in the blog entry and the tests, then it's fine. I've fixed the issue by writing a method ActionView::Base.view_paths to reference @controller.view_paths if @controller exists so it will always use the current paths. I'm working on a test to demonstrate the problem and solution. On 6/5/07, Mislav Marohnić <[EMAIL PROTECTED]> wrote: > On 6/6/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). > > From quick observation of controller code I think you can, but I can not > imagine why would one do that. > > AC::Base#process is called on a per-request basis. It calls > initialize_template_class, which instantiates a new ActionView::Base > instance, passing it current view_paths as argument. If view_paths change, > new requests should therefore pick it up. > > I may be also wrong, this was just a quick observation. But I still don't > understand what the problem is, Gabe didn't explain it too well. > > > > > -- 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 -~----------~----~----~----~------~----~------~--~---
