-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Nest lessons in Courses and fix issues
- Loading branch information
1 parent
7daa3c4
commit 0849a06
Showing
9 changed files
with
26 additions
and
22 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,13 @@ | ||
.card | ||
.card-header | ||
= link_to lesson.title, lesson | ||
= link_to lesson.title, [@course, lesson] | ||
- if policy(lesson).show? | ||
.card-body | ||
= lesson.content | ||
= lesson.course | ||
- if policy(lesson).edit? | ||
.card-footer | ||
= link_to 'Edit', edit_lesson_path(lesson), class: 'btn btn-sm btn-warning' | ||
= link_to 'Destroy', lesson, data: { turbo_method: :delete, confirm: 'Are you sure' }, class: 'btn btn-sm btn-danger' | ||
= link_to 'Edit', edit_course_lesson_path(@course, lesson), class: 'btn btn-sm btn-warning' | ||
= link_to 'Destroy', [@course, lesson], data: { turbo_method: :delete, confirm: 'Are you sure' }, class: 'btn btn-sm btn-danger' | ||
%p | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,4 +2,4 @@ | |
|
||
= render 'form' | ||
|
||
= link_to 'Back', lessons_path | ||
= link_to 'Back', course_path(@course) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,9 @@ | ||
= link_to 'Courses', courses_path | ||
\/ | ||
= link_to @lesson.course.title, course_path(@lesson.course) | ||
= link_to @lesson.course.title, course_path(@course) | ||
\/ | ||
= link_to @lesson.title, lesson_path(@lesson) | ||
= link_to @lesson.title, course_lesson_path(@course, @lesson) | ||
|
||
= render 'lessons/lesson', lesson: @lesson | ||
|
||
= link_to 'Back to course', course_path(@lesson.course) | ||
= link_to 'Back to course', course_path(@course) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters