
Untitled
By: a guest on Feb 12th, 2012 | syntax:
None | size: 0.58 KB | hits: 35 | expires: Never
class SessionsController < Devise::SessionsController
private
def format_suffix
"." + request.format.to_sym.to_s
end
def stored_location_for(resource_or_scope)
scope = Devise::Mapping.find_scope!(resource_or_scope)
session.key?(:"#{scope}_return_to") ? session.delete(:"#{scope}_return_to") + format_suffix : nil
end
def after_sign_in_path_for(resource_or_scope)
scope = Devise::Mapping.find_scope!(resource_or_scope)
home_path = :"#{scope}_root_path"
respond_to?(home_path, true) ? send(home_path) + format_suffix : root_path + format_suffix
end
end