Module: TemplateHelper

Defined in:
lib/install_theme/templates/app/helpers/template_helper.rb

Instance Method Summary collapse

Instance Method Details

#render_or_default(partial, default = partial) ⇒ Object



2
3
4
5
6
7
8
9
10
# File 'lib/install_theme/templates/app/helpers/template_helper.rb', line 2

def render_or_default(partial, default = partial)
  render :partial => partial
rescue ActionView::MissingTemplate
  begin
    render :partial => "layouts/#{default}"
  rescue ActionView::MissingTemplate
    nil
  end
end