Sha256: 112ca95a775bee1fb21f200830487627cea579153bd76879efdce5efc0dacca6

Contents?: true

Size: 469 Bytes

Versions: 9

Compression:

Stored size: 469 Bytes

Contents

module StaticMatic::RescueMixin
  # Pass back an error template for the given exception
  def render_rescue_from_error(exception)
    rescue_template     = (exception.is_a?(StaticMatic::TemplateError)) ? "template" : "default"
      
    error_template_path = File.expand_path(File.dirname(__FILE__) + "/../templates/rescues/#{rescue_template}.haml")
    
    @scope.instance_variable_set("@exception", exception)
    
    render_template(error_template_path)
  end
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
staticmatic2-2.1.8 lib/staticmatic/mixins/rescue.rb
staticmatic2-2.1.7 lib/staticmatic/mixins/rescue.rb
staticmatic2-2.1.6 lib/staticmatic/mixins/rescue.rb
staticmatic2-2.1.5 lib/staticmatic/mixins/rescue.rb
staticmatic2-2.1.4 lib/staticmatic/mixins/rescue.rb
staticmatic2-2.1.3 lib/staticmatic/mixins/rescue.rb
staticmatic2-2.1.2 lib/staticmatic/mixins/rescue.rb
staticmatic2-2.1.1 lib/staticmatic/mixins/rescue.rb
staticmatic2-2.1.0 lib/staticmatic/mixins/rescue.rb