Class: Kublog::ApplicationController
- Inherits:
-
ActionController::Base
- Object
- ActionController::Base
- Kublog::ApplicationController
- Defined in:
- app/controllers/kublog/application_controller.rb
Direct Known Subclasses
CategoriesController, CommentsController, ImagesController, NotificationsController, PostsController
Instance Method Summary collapse
-
#current_user ⇒ Object
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.
-
#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.
- #require_admin ⇒ Object
Instance Method Details
#current_user ⇒ Object
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
23 24 25 |
# File 'app/controllers/kublog/application_controller.rb', line 23 def is_admin? end |
#require_admin ⇒ Object
8 9 10 |
# File 'app/controllers/kublog/application_controller.rb', line 8 def require_admin redirect_to root_path unless is_admin? end |