Module: AbstractController::ViewPaths

Extended by:
ActiveSupport::Concern
Included in:
Rendering
Defined in:
lib/abstract_controller/view_paths.rb

Defined Under Namespace

Modules: ClassMethods

Instance Method Summary collapse

Instance Method Details

#append_view_path(path) ⇒ Object


25
26
27
# File 'lib/abstract_controller/view_paths.rb', line 25

def append_view_path(path)
  lookup_context.view_paths.push(*path)
end

#details_for_lookupObject


21
22
23
# File 'lib/abstract_controller/view_paths.rb', line 21

def details_for_lookup
  { }
end

#lookup_contextObject

LookupContext is the object responsible to hold all information required to lookup templates, i.e. view paths and details. Check ActionView::LookupContext for more information.


17
18
19
# File 'lib/abstract_controller/view_paths.rb', line 17

def lookup_context
  @lookup_context ||= ActionView::LookupContext.new(self.class._view_paths, details_for_lookup)
end

#prepend_view_path(path) ⇒ Object


29
30
31
# File 'lib/abstract_controller/view_paths.rb', line 29

def prepend_view_path(path)
  lookup_context.view_paths.unshift(*path)
end