Skip to content

Instantly share code, notes, and snippets.

@pch pch/gist:837658
Created Feb 21, 2011

Embed
What would you like to do?
module Devise
module Controllers
module ScopedViews
protected
# Monkey path for generating proper templates path when dealing with
# namespaced resources and custom views.
def render_with_scope(action, options={})
controller_name = options.delete(:controller) || self.controller_name
if self.class.scoped_views?
begin
render :template => "#{devise_mapping.fullpath}/#{controller_name}/#{action}"
rescue ActionView::MissingTemplate
render :template => "#{controller_path}/#{action}"
end
else
render :template => "#{controller_path}/#{action}"
end
end
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.