TheOdinProject / curriculum

The open curriculum for learning web development
https://www.theodinproject.com/
Other
9.96k stars 13.33k forks source link

Add answers to warm up data model exercises in rails #23343

Open DigitalKnight0 opened 2 years ago

DigitalKnight0 commented 2 years ago

In the micro-reddit and private events project, The warmup part should have some answers linked so the users can compare their solutions to check whether they got it right or not. This helps in understanding associations better as they can research and rectify their mistake before starting the project. Currently, the only option they have is to post their solutions in the discord and ask for feedback, i think it might be better to link a repo or something with the correct answers

rlmoser99 commented 2 years ago

I do not think providing a repo with the answers is the best solution, because there can be different ways to implement associations. One thought that I've had in the past, but haven't developed is to create a test-driven approach to this. If the tests pass, you can be certain that you've written the associations correctly.

Is this something you'd be interested into working on?

DigitalKnight0 commented 2 years ago

@rlmoser99 I would love to, but i am myself currently on private events project and quite unsure of how testing is done with rails. I can prolly get started with some guidance but still your call

rlmoser99 commented 2 years ago

Ok. Before we decide on anything, let me touch base with the rest of the Rails team and see where this fits in with our current plans. Thanks for creating an issue to help find a way to provide feedback on those association warm ups. 👍

dm-murphy commented 2 years ago

If you're seeking contributors to help add a test-driven approach here or elsewhere in the Rails curriculum, I'd love to help! :-)

rlmoser99 commented 2 years ago

@DigitalKnight0 @dm-murphy Quick Update: I've talked with a few other Rails maintainers and we think the TDD approach would be the best direction to go. The tests that I have mind (and have some sample ones written) will not be the typical Rails association tests, because they give away the answers... and are in general pretty pointless!

However, we don't want to create 8 new repos for Rails applications just for these warm-up exercises. So, it was suggested to use Rails Templates for this project. I am in the middle of another project, so it will take me some time to investigate how best to move forward with using templates and then I'll create issues to turn each warm-up exercise into a template that provides test files.

In the meantime, as you go through the Rails curriculum, I suggest learning about testing with codewithjason and FactoryBot.

dm-murphy commented 2 years ago

@DigitalKnight0 @dm-murphy Quick Update: I've talked with a few other Rails maintainers and we think the TDD approach would be the best direction to go. The tests that I have mind (and have some sample ones written) will not be the typical Rails association tests, because they give away the answers... and are in general pretty pointless!

However, we don't want to create 8 new repos for Rails applications just for these warm-up exercises. So, it was suggested to use Rails Templates for this project. I am in the middle of another project, so it will take me some time to investigate how best to move forward with using templates and then I'll create issues to turn each warm-up exercise into a template that provides test files.

In the meantime, as you go through the Rails curriculum, I suggest learning about testing with codewithjason and FactoryBot.

Thanks for the update!

I'm almost done working through The Complete Guide to Rails Testing from codewithjason and I've found it really helpful and clear. Both the free content from the site and the full book could be great resources in the curriculum.

CouchofTomato commented 2 years ago

I'm almost done working through The Complete Guide to Rails Testing from codewithjason and I've found it really helpful and clear. Both the free content from the site and the full book could be great resources in the curriculum.

I agree although the full book is a paid resource which means we could only at most add it to the additional resources section

github-actions[bot] commented 2 years ago

This issue is stale because it has been open for 30 days with no activity.

rlmoser99 commented 1 year ago

@TheOdinProject/rails-path I am not sure we have this idea documented with our newer plans for rails updates. I still very much want to see this, but it just hasn't been a top priority.

https://github.com/TheOdinProject/top-meta/issues/173

ChargrilledChook commented 1 year ago

@rlmoser99 Although the TDD idea is really good, is there perhaps a lower tech and simpler solution we could implement in the meantime? For someting like this section referenced in the original issue , we could simply add a spoiler tag in the lesson with solutions

This could be a good contribution for someone deep in the Rails path to make

github-actions[bot] commented 1 year ago

This issue is stale because it has had no activity for the last 30 days.

github-actions[bot] commented 1 year ago

This issue is stale because it has had no activity for the last 30 days.