Skip to content

Instantly share code, notes, and snippets.

@DCarper
Created October 27, 2010 20:04
Show Gist options
  • Select an option

  • Save DCarper/649841 to your computer and use it in GitHub Desktop.

Select an option

Save DCarper/649841 to your computer and use it in GitHub Desktop.
Overriding a default template path
class MassEmailsController < InheritedResources::Base
before_filter :prefix_template
private
def prefix_template
def self.default_template_name(action_name = self.action_name)
if action_name
action_name = action_name.to_s
if action_name.include?('/') && template_path_includes_controller?(action_name)
action_name = strip_out_controller(action_name)
end
end
"admin/#{self.controller_path}/#{action_name}"
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment