Class: Kublog::ApplicationController

Inherits:
ActionController::Base
  • Object
show all
Defined in:
app/controllers/kublog/application_controller.rb

Instance Method Summary collapse

Instance Method Details

#current_userObject

TODO: Fill in this method This method should return the logged in user or nil Define this whether or not you have it on your application controller Apps using Devise can skip this



16
17
18
# File 'app/controllers/kublog/application_controller.rb', line 16

def current_user

end

#is_admin?Boolean

TODO: Fill in this method Returns if the current user has admin privileges for the blog Define this whether or not you have the method on your application controller

Returns:

  • (Boolean)


23
24
25
# File 'app/controllers/kublog/application_controller.rb', line 23

def is_admin?

end

#require_adminObject



8
9
10
# File 'app/controllers/kublog/application_controller.rb', line 8

def require_admin
  redirect_to root_path unless is_admin?
end