Skip to content
This repository
Browse code

Still need to setup view paths

  • Loading branch information...
commit 5c63be1f92edcd3ed60fae90b8eb129da19c5099 1 parent 893e9eb
Joshua Peek josh authored

Showing 1 changed file with 12 additions and 0 deletions. Show diff stats Hide diff stats

  1. +12 0 railties/lib/initializer.rb
12 railties/lib/initializer.rb
@@ -181,6 +181,9 @@ def process
181 181 # Observers are loaded after plugins in case Observers or observed models are modified by plugins.
182 182 load_observers
183 183
  184 + # Load view path cache
  185 + load_view_paths
  186 +
184 187 # Load application classes
185 188 load_application_classes
186 189
@@ -364,6 +367,15 @@ def load_observers
364 367 end
365 368 end
366 369
  370 + def load_view_paths
  371 + if configuration.frameworks.include?(:action_view)
  372 + if configuration.cache_classes
  373 + ActionController::Base.view_paths = configuration.view_path if configuration.frameworks.include?(:action_controller)
  374 + ActionMailer::Base.template_root = view_path if configuration.frameworks.include?(:action_mailer)
  375 + end
  376 + end
  377 + end
  378 +
367 379 # Eager load application classes
368 380 def load_application_classes
369 381 return if $rails_rake_task

4 comments on commit 5c63be1

Stephan Kaag

This commit broke the situations where cache_classes is true.

undefined local variable or method `view_path’ for # (NameError)

Stephan Kaag

^ for Rails::Initializer

Joshua Peek
Collaborator

Can you please comment on http://rails.lighthouseapp.com/projects/8994/tickets/1909

Lourens Naudé

Small typo :

http://github.com/methodmissing/rails/commit/2332de3ad90d33b0b18e6afebb045f157e58f354

Please sign in to comment.
Something went wrong with that request. Please try again.