Can you describe step by step: 1. how did you set up view_paths, 2. what did you expect when you changed something, 3. what happened in turn.
There is no code that can change view_paths. There isn't even a writer for the instance variable, just reader! Are you sure you're debugging right? Can you provide a failing test? On 6/6/07, dasil003 <[EMAIL PROTECTED]> wrote: > > > After closer examination, the problem is even weirder. As far as I > can tell, ActionView::Base.view_paths is ONLY set in the initialize > function. However, I put a debug statement in there and > ActionView::Base is initialized only once, yet somehow the value of > @view_paths changes in the middle of the execution. I reviewed the > original patch and it looks like the layout module finds it's own > template outside of ActionView, which would explain why it finds the > right layout, but it doesn't explain how @view_paths is being updated > inside ActionView::Base where my debugging statement is. > > On Jun 5, 3:44 pm, dasil003 <[EMAIL PROTECTED]> wrote: > > Hi, I'm pretty new to hacking Rails internals, but I've recently > > switched to edge for several reasons. One of which is the use of the > > multiple controller view paths announced > athttp://weblog.rubyonrails.com/2007/2/4/new-feature-for-rails-2-0-mult... > > > > Anyway, I've developed a plugin that prepends an additional path much > > as described in the article. The problem is that it is working for > > layouts, but not regular templates. If I remove the regular template > > from the default views directory then it does work, but when it exists > > it is not being overriden correctly. > > > > I'm working on debugging this issue and creating a patch, but I > > figured someone might be able to point me more quickly in the right > > direction. I have stuck debug information in a few places, so I can > > verify that the following is happening: > > > > * 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. > > > > > --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
