Module: Api::V1::Memberships::ControllerBase
- Extended by:
- ActiveSupport::Concern
- Defined in:
- app/controllers/concerns/api/v1/memberships/controller_base.rb
Defined Under Namespace
Modules: StrongParameters
Instance Method Summary collapse
-
#create ⇒ Object
POST /api/v1/teams/:team_id/memberships.
-
#destroy ⇒ Object
DELETE /api/v1/memberships/:id.
-
#index ⇒ Object
GET /api/v1/teams/:team_id/memberships.
-
#show ⇒ Object
GET /api/v1/memberships/:id.
-
#update ⇒ Object
PUT /api/v1/memberships/:id.
Instance Method Details
#create ⇒ Object
POST /api/v1/teams/:team_id/memberships
41 42 43 44 45 46 47 |
# File 'app/controllers/concerns/api/v1/memberships/controller_base.rb', line 41 def create if @membership.save render :show, status: :created, location: [:api, :v1, @membership] else render json: @membership.errors, status: :unprocessable_entity end end |
#destroy ⇒ Object
DELETE /api/v1/memberships/:id
59 60 61 |
# File 'app/controllers/concerns/api/v1/memberships/controller_base.rb', line 59 def destroy @membership.destroy end |
#index ⇒ Object
GET /api/v1/teams/:team_id/memberships
33 34 |
# File 'app/controllers/concerns/api/v1/memberships/controller_base.rb', line 33 def index end |
#show ⇒ Object
GET /api/v1/memberships/:id
37 38 |
# File 'app/controllers/concerns/api/v1/memberships/controller_base.rb', line 37 def show end |
#update ⇒ Object
PUT /api/v1/memberships/:id
50 51 52 53 54 55 56 |
# File 'app/controllers/concerns/api/v1/memberships/controller_base.rb', line 50 def update if @membership.update(membership_params) render :show else render json: @membership.errors, status: :unprocessable_entity end end |