Class: Wobauth::AuthoritiesController
- Inherits:
-
ApplicationController
- Object
- ActionController::Base
- ApplicationController
- Wobauth::AuthoritiesController
- Defined in:
- app/controllers/wobauth/authorities_controller.rb
Direct Known Subclasses
Instance Method Summary collapse
-
#create ⇒ Object
POST /authorities.
-
#destroy ⇒ Object
DELETE /authorities/1.
-
#edit ⇒ Object
GET /authorities/1/edit.
-
#index ⇒ Object
GET /authorities.
-
#new ⇒ Object
GET /authorities/new.
-
#show ⇒ Object
GET /authorities/1.
-
#update ⇒ Object
PATCH/PUT /authorities/1.
Methods inherited from ApplicationController
Instance Method Details
#create ⇒ Object
POST /authorities
37 38 39 40 41 42 43 44 45 46 47 |
# File 'app/controllers/wobauth/authorities_controller.rb', line 37 def create myparams = .merge() if @authorizable.present? @authority = @authorizable..new(myparams) else @authority = Authority.new(myparams) end @authority.save respond_with(@authority, location: location) end |
#destroy ⇒ Object
DELETE /authorities/1
56 57 58 59 |
# File 'app/controllers/wobauth/authorities_controller.rb', line 56 def destroy @authority.destroy respond_with(@authority, location: location) end |
#edit ⇒ Object
GET /authorities/1/edit
33 34 |
# File 'app/controllers/wobauth/authorities_controller.rb', line 33 def edit end |
#index ⇒ Object
GET /authorities
12 13 14 15 |
# File 'app/controllers/wobauth/authorities_controller.rb', line 12 def index @authorities = Authority.accessible_by(current_ability, :read) respond_with(@authorities) end |
#new ⇒ Object
GET /authorities/new
23 24 25 26 27 28 29 30 |
# File 'app/controllers/wobauth/authorities_controller.rb', line 23 def new if @authorizable.present? @authority = @authorizable..new() else @authority = Authority.new() end respond_with(@authority) end |
#show ⇒ Object
GET /authorities/1
18 19 20 |
# File 'app/controllers/wobauth/authorities_controller.rb', line 18 def show respond_with(@authority) end |
#update ⇒ Object
PATCH/PUT /authorities/1
50 51 52 53 |
# File 'app/controllers/wobauth/authorities_controller.rb', line 50 def update @authority.update() respond_with(@authority, location: location) end |