class Superuser::BaseController

Private Instance Methods

authenticated_superuser() click to toggle source

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

# File lib/generators/superuser/templates/base_controller.rb, line 22
def authenticated_superuser
        # SET YOUR CONDITION HERE TO PREVENT ACCESSING THE ADMIN AREA FROM ANYONE
        # example: redirect_to root_url if !current_user || current_user.role != 'admin'
end
flash_class(key) click to toggle source
# File lib/generators/superuser/templates/base_controller.rb, line 44
                  def flash_class(key)
  case key
    when "success" then "alert alert-success"
    when "warning" then "alert alert-warning"
    when "notice" then "alert alert-info"
    when "alert" then "alert alert-danger"
  end
end