app/controllers/mtdevise/application_controller.rb in mtdevise-1.7.0 vs app/controllers/mtdevise/application_controller.rb in mtdevise-1.7.1
- old
+ new
@@ -1,11 +1,10 @@
module Mtdevise
# class ApplicationController < ActionController::Base
class ApplicationController < ::ApplicationController
protect_from_forgery with: :null_session
-
before_action :check_subdomain
def after_sign_in_path_for(resource)
request.env['omniauth.origin'] || stored_location_for(resource) || mtdevise.accounts_path
end
@@ -28,9 +27,20 @@
end
def check_subdomain
if request.subdomain.present? && Account.where(subdomain: request.subdomain).blank?
redirect_to mtdevise.root_url(subdomain: false), notice: "Subdomain Doesn't Exist. Would you like to Register."
+ end
+ end
+
+ def layouts_rsolver
+ case action_name
+ when "index"
+ "mtdevise/accountsindex"
+ when devise_controller? && resource_name == :user && action_name == "edit"
+ "mtdevise/accountsedit"
+ else
+ "mtdevise/accounts"
end
end
end
\ No newline at end of file