Module: Fiveruns::Dash::Rails::TemplateContext::InstanceMethods

Defined in:
lib/fiveruns/dash/template_context.rb

Instance Method Summary collapse

Instance Method Details

#render_with_fiveruns_dash_context(*args, &block) ⇒ Object



34
35
36
37
38
39
40
41
42
43
44
45
46
47
# File 'lib/fiveruns/dash/template_context.rb', line 34

def render_with_fiveruns_dash_context(*args, &block)
  original_context = Fiveruns::Dash::Context.context.dup
  
  begin
    template = Fiveruns::Dash::Rails::TemplateContext.sanitize_view_path(path)
    Fiveruns::Dash::Context.context << 'view'
    Fiveruns::Dash::Context.context << template
    result = render_without_fiveruns_dash_context(*args, &block)
  ensure
    Fiveruns::Dash::Context.set original_context
  end
  
  result
end