Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix missing attribute error and typo in Getting Started: Using Concerns #40847

Merged
merged 2 commits into from Dec 16, 2020

Conversation

david-eom
Copy link
Contributor

Summary

By following the guide "Using Concerns", application will raise ActiveModel::MissingAttributeError.

This is because status column is not added, and user did not provide the status parameter when creating articles and comments.

The following three actions will fix this issue:

  1. Run migration commands (with reference to https://guides.rubyonrails.org/active_record_migrations.html#creating-a-standalone-migration)
  2. Include a select box in forms when user creates/edits articles and comments
  3. Permit :status key in strong parameter

Fix a slight typo for module Visible to make it identical to previous appearances

Other Information

As a new programmer who just started learning programming as well as Ruby on Rails, I spent quite some time searching for possible typo in my code, only come to realise that the guide was actually not a complete one that lets the rails app run without error.

I do hope that even if my changes were not accepted, the guide could still include a paragraph indicating that "extra steps need to be taken, but we will not delve too deep here".

Thanks in advance!

By following the guide "Using Concerns", application will raise `ActiveModel::MissingAttributeError` as` status` column is not added.
The following three actions will fix this issue:
1. run migration commands
2. include a select box in forms when creating/editing articles and comments
3. permit `:status` key in strong parameter

With reference to:
https://guides.rubyonrails.org/active_record_migrations.html#creating-a-standalone-migration

Fix a slight typo for module `Visible`.
@rails-bot rails-bot bot added the docs label Dec 15, 2020
@rafaelfranca rafaelfranca merged commit 4b22899 into rails:master Dec 16, 2020
rafaelfranca added a commit that referenced this pull request Dec 16, 2020
Fix missing attribute error and typo in Getting Started: Using Concerns
@david-eom david-eom deleted the david-eom-patch-getting-started branch December 17, 2020 03:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants