Repository navigation
Adding a Lesson
- Go to
db/fixtures/lessonsand choose the appropriate file that the lesson should go in. - Add the new lesson's 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 might look like when you are done:
'Your New Lesson Title' => {
title: 'Your New Lesson Title',
description: 'This is a new lesson',
is_project: false # or true if a project
github_path: '/foundations/new_lesson_github_path.md',
identifier_uuid: 'create_uuid',
}If adding a project, make sure is_project is set to true. Projects should also have the following two boolean attributes (which will determine if users can submit their work for that project, and if submissions should have an optional "Live Preview" field, respectively):
accepts_submissionpreviewable
- 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 🚀