Implement update
This commit is contained in:
@ -1,6 +1,7 @@
|
||||
class ExerciseCollectionsController < ApplicationController
|
||||
include CommonBehavior
|
||||
|
||||
before_action :set_exercise_collection, only: [:show]
|
||||
before_action :set_exercise_collection, only: [:show, :edit, :update]
|
||||
|
||||
def index
|
||||
@exercise_collections = ExerciseCollection.all.paginate(:page => params[:page])
|
||||
@ -10,6 +11,12 @@ class ExerciseCollectionsController < ApplicationController
|
||||
def show
|
||||
end
|
||||
|
||||
def edit
|
||||
end
|
||||
|
||||
def update
|
||||
update_and_respond(object: @exercise_collection, params: exercise_collection_params)
|
||||
end
|
||||
|
||||
private
|
||||
|
||||
@ -21,4 +28,8 @@ class ExerciseCollectionsController < ApplicationController
|
||||
def authorize!
|
||||
authorize(@exercise_collection || @exercise_collections)
|
||||
end
|
||||
|
||||
def exercise_collection_params
|
||||
params[:exercise_collection].permit(:name, :exercise_ids)
|
||||
end
|
||||
end
|
||||
|
Reference in New Issue
Block a user