From 8b4036feca85463fe8098b1f6c52af7b425ec13c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Valim?= Date: Tue, 15 Dec 2009 18:48:00 +0100 Subject: [PATCH] Allow :controller to be given to render_with_scope. --- lib/devise/controllers/helpers.rb | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/lib/devise/controllers/helpers.rb b/lib/devise/controllers/helpers.rb index 2d1f245b..be41354c 100644 --- a/lib/devise/controllers/helpers.rb +++ b/lib/devise/controllers/helpers.rb @@ -97,15 +97,17 @@ module Devise end # Render a view for the specified scope. Turned off by default. - def render_with_scope(action) + # Accepts just :controller as option. + def render_with_scope(action, options={}) +  controller_name = options.delete(:controller) || self.controller_name if Devise.scoped_views begin render :template => "#{controller_name}/#{devise_mapping.as}/#{action}" rescue ActionView::MissingTemplate - render action + render action, :controller => controller_name end else - render action + render action, :controller => controller_name end end