-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Adding A Path
Kevin Mulhern edited this page Feb 23, 2023
·
3 revisions
-
Create a new path directory under
db/fixtures/paths/
- name the new path directory the same as what the new paths title will be on the site. for examplefoundations
orfull_stack_javascript
etc. -
Create a new
seed.rb
file in the path directory you just created. -
At the top of the
seed.rb
file, create your new path:
@path = Seeds::PathSeeder.build do |path|
end
- Give the path a title:
@path = Seeds::PathSeeder.build do |path|
path.title = 'Full Stack JavaScript'
end
- Give the path a description:
@path = Seeds::PathSeeder.build do |path|
path.title = 'Full Stack JavaScript'
path.description = "This path teaches you x and y"
end
- Give the path an identifier_uuid attribute value of
'create_uuid'
. This will be replaced by a real uuid automatically when the seed script is run later.
@path = Seeds::PathSeeder.build do |path|
path.title = 'Full Stack JavaScript'
path.description = "This path teaches you x and y"
path.identifier_uuid = 'create_uuid'
end
- Finally give your path a position, this attribute determines what position the path will be displayed at on the https://www.theodinproject.com/paths page.
@path = Seeds::PathSeeder.build do |path|
path.title = 'Full Stack JavaScript'
path.description = "This path teaches you x and y"
path.identifier_uuid = 'create_uuid'
path.position = 3
end
- Add courses, sections and lessons to the path using these guides:
- Add the Clean up step to the bottom of the seed.rb file - This will clean up any removed courses from the path in the future.
@path.delete_removed_courses
- Run the seeds task:
bin/rails db:seed
- Run the app locally and check the path is where it should be and contains the courses, sections and lessons you expect.
- 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 🚀