Sha256: 70d990c44a954641b075c026e6d5f8ef8a4e8daa16121212e5f5978034332574

Contents?: true

Size: 1.14 KB

Versions: 57

Compression:

Stored size: 1.14 KB

Contents

class ApplicationController < ActionController::Base
  # Prevent CSRF attacks by raising an exception.
  # For APIs, you may want to use :null_session instead.
  protect_from_forgery with: :exception
  

  #use this line to directly include the layout from the engine.
  #layout 'auth/application'  
  layout 'application'
  respond_to :html,:js,:json
  

  ###NOW TESTING ALL THE PATH OVERRIDES.
  ###THESE ARE OVERRIDDEN FOR ADMIN ONLY.
  ##i also have to test the path helpers.
  def after_sign_in_path_for(resource)
    if resource.class.name.to_s == "Admin"
      ##we wanna set a different path, and test that it goes there in the specs.
      new_topic_path
    else
      super
    end
  end

  def after_sign_out_path_for(resource)
    super
  end

  def after_sign_up_path_for(resource)
    super
  end

  def after_inactive_sign_up_path_for(resource)
    super
  end

  protected

  def devise_parameter_sanitizer
    if resource_class == User
      User::ParameterSanitizer.new(User, :user, params)
    elsif resource_class == Admin
      Admin::ParameterSanitizer.new(Admin,:admin,params)
    else
      super # Use the default one
    end
  end

end

Version data entries

57 entries across 57 versions & 1 rubygems

Version Path
wordjelly-auth-1.6.0 spec/dummy/app/controllers/application_controller.rb
wordjelly-auth-1.5.9 spec/dummy/app/controllers/application_controller.rb
wordjelly-auth-1.5.8 spec/dummy/app/controllers/application_controller.rb
wordjelly-auth-1.5.7 spec/dummy/app/controllers/application_controller.rb
wordjelly-auth-1.5.6 spec/dummy/app/controllers/application_controller.rb
wordjelly-auth-1.5.5 spec/dummy/app/controllers/application_controller.rb
wordjelly-auth-1.5.4 spec/dummy/app/controllers/application_controller.rb
wordjelly-auth-1.5.3 spec/dummy/app/controllers/application_controller.rb
wordjelly-auth-1.5.2 spec/dummy/app/controllers/application_controller.rb
wordjelly-auth-1.5.1 spec/dummy/app/controllers/application_controller.rb
wordjelly-auth-1.5.0 spec/dummy/app/controllers/application_controller.rb
wordjelly-auth-1.4.9 spec/dummy/app/controllers/application_controller.rb
wordjelly-auth-1.4.8 spec/dummy/app/controllers/application_controller.rb
wordjelly-auth-1.4.7 spec/dummy/app/controllers/application_controller.rb
wordjelly-auth-1.4.6 spec/dummy/app/controllers/application_controller.rb
wordjelly-auth-1.4.5 spec/dummy/app/controllers/application_controller.rb
wordjelly-auth-1.4.4 spec/dummy/app/controllers/application_controller.rb
wordjelly-auth-1.4.3 spec/dummy/app/controllers/application_controller.rb
wordjelly-auth-1.4.2 spec/dummy/app/controllers/application_controller.rb
wordjelly-auth-1.4.0 spec/dummy/app/controllers/application_controller.rb