Class: RbacRls::PermissionsController
- Inherits:
-
ApplicationController
- Object
- ActionController::Base
- ApplicationController
- RbacRls::PermissionsController
- Defined in:
- app/controllers/rbac_rls/permissions_controller.rb
Instance Method Summary collapse
-
#create ⇒ Object
POST /permissions.
-
#destroy ⇒ Object
DELETE /permissions/1.
-
#edit ⇒ Object
GET /permissions/1/edit.
-
#index ⇒ Object
GET /permissions.
-
#new ⇒ Object
GET /permissions/new.
-
#show ⇒ Object
GET /permissions/1.
-
#update ⇒ Object
PATCH/PUT /permissions/1.
Instance Method Details
#create ⇒ Object
POST /permissions
24 25 26 27 28 29 30 31 32 33 |
# File 'app/controllers/rbac_rls/permissions_controller.rb', line 24 def create @permission = Permission.new() if @permission.save redirect_to @permission, notice: "Permission was successfully created." else render :new, status: :unprocessable_entity end end |
#destroy ⇒ Object
DELETE /permissions/1
45 46 47 48 49 50 51 52 |
# File 'app/controllers/rbac_rls/permissions_controller.rb', line 45 def destroy notice_msg = "Permission was successfully destroyed." @permission.destroy if @permission.errors.size > 0 notice_msg = @permission.errors&.&.first&.last&.last end redirect_to , notice: notice_msg end |
#edit ⇒ Object
GET /permissions/1/edit
20 21 |
# File 'app/controllers/rbac_rls/permissions_controller.rb', line 20 def edit end |
#index ⇒ Object
GET /permissions
6 7 8 |
# File 'app/controllers/rbac_rls/permissions_controller.rb', line 6 def index @permissions = Permission.all end |
#new ⇒ Object
GET /permissions/new
15 16 17 |
# File 'app/controllers/rbac_rls/permissions_controller.rb', line 15 def new @permission = Permission.new end |
#show ⇒ Object
GET /permissions/1
11 12 |
# File 'app/controllers/rbac_rls/permissions_controller.rb', line 11 def show end |
#update ⇒ Object
PATCH/PUT /permissions/1
36 37 38 39 40 41 42 |
# File 'app/controllers/rbac_rls/permissions_controller.rb', line 36 def update if @permission.update() redirect_to @permission, notice: "Permission was successfully updated." else render :edit, status: :unprocessable_entity end end |