-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Adding a Section
Eric Olkowski edited this page Mar 17, 2022
·
4 revisions
- First find the path you want to add the section to in
db/fixtures/paths/
. - Next find the course in that path you want the section to appear in
db/fixtures/paths/<selected_path>/courses/
. - When you have found the course the section should be in, you next have to determine what where the section will appear in the course. The order that sections are added to the course seed file matters as it uses that to position the section on the site. A good rule of thumb is to find the section your new section will appear after on site.
- When you have the position figured out add the section:
course.add_section do |section|
end
- Give the section a title:
course.add_section do |section|
section.title = 'A New Section Title'
end
- Give the section a description:
course.add_section do |section|
section.title = 'A New Section Title'
section.description = 'A brief description of what the section covers.'
end
- Generate a unique uuid and give the section an identifier_uuid attribute:
course.add_section do |section|
section.title = 'A New Section Title'
section.description = 'A brief description of what the section covers.'
section.identifier_uuid = '<paste the uuid you generated here>'
end
- Add lessons to the section, using our adding a lesson guide to find out how to add lessons:
course.add_section do |section|
section.title = 'A New Section Title'
section.description = 'A brief description of what the section covers.'
section.identifier_uuid = '<paste the uuid you generated here>'
section.add_lessons(
ruby_lessons.fetch('A new lesson'),
ruby_lessons.fetch('Another new lesson'),
)
end
- Run the seeds task rails db:seed
- Run the app locally and check the section 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 🚀