Implement show route

This commit is contained in:
Maximilian Grundke
2017-09-27 16:52:42 +02:00
parent 93797a665d
commit f0c0621b31
2 changed files with 15 additions and 1 deletions

View File

@ -2,4 +2,8 @@ class ExerciseCollection < ActiveRecord::Base
has_and_belongs_to_many :exercises has_and_belongs_to_many :exercises
def to_s
"#{I18n.t('activerecord.models.exercise_collection.one')}: #{name} (#{id})"
end
end end

View File

@ -1 +1,11 @@
h1 = 'ExerciseCollection#show' h1
= @exercise_collection
= render('shared/edit_button', object: @exercise_collection)
= row(label: 'exercise_collections.name', value: @exercise_collection.name)
= row(label: 'exercise_collections.updated_at', value: @exercise_collection.updated_at)
h4 = t('activerecord.attributes.exercise_collections.exercises')
ul.list-unstyled
- @exercise_collection.exercises.sort_by{|c| c.title}.each do |exercise|
li = exercise