Scaffold exercise collection routes

This commit is contained in:
Maximilian Grundke
2017-09-27 16:08:56 +02:00
parent af67208fd3
commit 44a3cabe98
6 changed files with 45 additions and 0 deletions

View File

@ -0,0 +1,24 @@
class ExerciseCollectionsController < ApplicationController
before_action :set_exercise_collection, only: [:show]
def index
@exercise_collections = ExerciseCollection.all
authorize!
end
def show
end
private
def set_exercise_collection
@exercise_collection = ExerciseCollection.find(params[:id])
authorize!
end
def authorize!
authorize(@exercise_collection || @exercise_collections)
end
end