Comments (6)
Thanks for the suggestion, I think this a good idea. I've assigned you @nikitarevenco
Just a couple of notes from me.
I'm not sure if a pipe will be enough of a visual separator between the two counts. But we could maybe use the same icons we use on course pages to do something like this:
To make getting these counts simpler and to save us needing to make two count queries for each course we render. We can add
lessons_count
andprojects_count
columns to our courses tableRails has a counter cache utility but I don't think we can use it here with the lesson model needing to be filtered by is_project.
Our courses can only be updated through our seeds files, so we could add a script that updates lesson and project counts for each course after the the curriculum is seeded in this file.
Whats your thoughts?
What a wonderful idea. I really like it a lot, however I don't think I will be able to complete this, as I have only just finished the foundations section and don't know anything about Rails to add a script like that. Can you please assign someone else?
from theodinproject.
Sure thing! we create and update our curriculum using Rails seeds in all environments including production. If we need to add, remove or update a lesson or project, we do it in the seeds. It's the perfect place to perform the counts we need for this feature. Our seeds docs might help make it clearer.
We basically need something like this in the seeds after we create all the curriculum records:
Course.all.each do |course|
course.update!(lessons_count: ..., projects_count: ...)
end
Does that make sense? happy to clarify anything that doesn't.
from theodinproject.
Thanks for the suggestion, I think this a good idea. I've assigned you @nikitarevenco
Just a couple of notes from me.
I'm not sure if a pipe will be enough of a visual separator between the two counts. But we could maybe use the same icons we use on course pages to do something like this:
To make getting these counts simpler and to save us needing to make two count queries for each course we render. We can add lessons_count
and projects_count
columns to our courses table
Rails has a counter cache utility but I don't think we can use it here with the lesson model needing to be filtered by is_project.
Our courses can only be updated through our seeds files, so we could add a script that updates lesson and project counts for each course after the the curriculum is seeded in this file.
Whats your thoughts?
from theodinproject.
Does this mean i can work on this? @KevinMulhern
from theodinproject.
Yep all yours @sparshalc, are you happy with the approach outlined in this comment?
from theodinproject.
Yep all yours @sparshalc, are you happy with the approach outlined in this comment?
"I'd like clarification on the statement: 'Our courses can only be updated through our seeds files, so we could add a script that updates lesson and project counts for each course after the curriculum is seeded in this file.' Can you please provide more details to help me understand this process better?"
from theodinproject.
Related Issues (20)
- Bug: Progress badge overlapping modals HOT 1
- Bug: Layout shift when closing modals on small screens HOT 1
- Bug: Markdown preview tool does not render dropdowns and summaries HOT 2
- Bug: Markdown preview doesn't work with <details> tag HOT 3
- Suggestion: Change links to 'unvisited' once a lesson has been unmarked as complete HOT 3
- Add “Continue” button and badge for selected path HOT 10
- Bug: EJS syntax highlighting not supported HOT 1
- Chore: Additional Prism language support HOT 2
- Feature Request: Level 4 headings render h4 > a with fragment (and id) HOT 9
- Chore: Wiki/Reflections from a Rails-newcomer HOT 5
- Feature Request: Link the markdown preview tool somewhere in the website itself
- Bug: <outdated hyperlinks of faq page> HOT 3
- Add Feature Flag HOT 1
- UI: draft requirements HOT 2
- Backend: Draft Requirements
- Database: Draft Requirements
- Backend: Get wordlist for predefined options
- Frontend: learn enough about Stimulus to use 'Slim Select' for the multi-select
- Next lesson button doesn't lead to the beginning of the next lesson. HOT 4
- Bug: Broken link HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from theodinproject.