Implement show route
This commit is contained in:
@ -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
|
@ -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
|
Reference in New Issue
Block a user