Module: StaticMatic::RescueMixin
- Included in:
- Base
- Defined in:
- lib/staticmatic/mixins/rescue.rb
Instance Method Summary collapse
-
#render_rescue_from_error(exception) ⇒ Object
Pass back an error template for the given exception.
Instance Method Details
#render_rescue_from_error(exception) ⇒ Object
Pass back an error template for the given exception
3 4 5 6 7 8 9 10 11 |
# File 'lib/staticmatic/mixins/rescue.rb', line 3 def render_rescue_from_error(exception) rescue_template = (exception.is_a?(StaticMatic::TemplateError)) ? "template" : "default" error_template_path = File.(File.dirname(__FILE__) + "/../templates/rescues/#{rescue_template}.haml") @scope.instance_variable_set("@exception", exception) render_template(error_template_path) end |