-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Adding a Lesson
Kevin Mulhern edited this page Feb 23, 2023
·
5 revisions
- Go to
db/fixtures/lessons
and choose the appropriate file that the lesson should go in. - Add the new lessons attributes to the bottom of the list.
- ** Important ** Make sure to give the lessons
identifier_uuid
attribute a value of'create_uuid'
. This will be replaced by a real uuid automatically when the seed script is run later.
This is what your new lesson attributes should look like when you are done:
},
'Your New Lesson Title' => {
title: 'Your New Lesson Title',
description: 'This is a new lesson',
github_path: '/foundations/new_lesson_github_path.md',
identifier_uuid: 'create_uuid',
},
}
- First find the path you want to add the lesson to in
db/fixtures/paths/
- Next find the course in that path you want the lesson to appear in
db/fixtures/paths/<selected_path>/courses/
- When you have found the correct path and course, you next have to find the section within that course you want the lesson to be in.
- When you have found the correct section simply add the lesson to the section by fetching the lesson using the title you provided in the attributes in step one of this guide:
Note: The order of the lessons matter. They will display on the website in the same order.
section.add_lessons(
foundation_lessons.fetch('Existing Lesson'),
foundation_lessons.fetch('My New Lesson'),
)
- Run the seeds task
bin/rails db:seed
- Run the app locally and check the lesson is where it should be.
- All done 🎉
Wiki Home | Odin Web App Home | Odin Site Home | Odin Org Home
Want to contribute to this wiki? Open an issue to suggest changes and improve these docs 🚀