Ruby on Rails | Screencasts | Download | Documentation | Weblog | Community | Source

Ticket #6295: remove_hardcoded_path_from_rescue_action_locally.diff

File remove_hardcoded_path_from_rescue_action_locally.diff, 0.7 kB (added by mnaberez, 3 years ago)

Patch to change rescues_action_locally to use rescues_path instead of a hardcoded relative path.

  • rescue.rb

    old new  
    6666      def rescue_action_locally(exception) 
    6767        add_variables_to_assigns 
    6868        @template.instance_variable_set("@exception", exception) 
    69         @template.instance_variable_set("@rescues_path", File.dirname(__FILE__) + "/templates/rescues/")     
     69        @template.instance_variable_set("@rescues_path", File.dirname(rescues_path("stub")))     
    7070        @template.send(:assign_variables_from_controller) 
    7171 
    7272        @template.instance_variable_set("@contents", @template.render_file(template_path_for_local_rescue(exception), false))