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
[RF DOCS] Active Model Basics Documentation [ci-skip] #51210
[RF DOCS] Active Model Basics Documentation [ci-skip] #51210
Conversation
Co-authored-by: Carlos Antonio da Silva <carlosantoniodasilva@gmail.com>
Co-authored-by: Carlos Antonio da Silva <carlosantoniodasilva@gmail.com>
Co-authored-by: Carlos Antonio da Silva <carlosantoniodasilva@gmail.com>
Co-authored-by: Carlos Antonio da Silva <carlosantoniodasilva@gmail.com>
<%= render "email_contact", email_contact: @email_contact %> | ||
``` | ||
|
||
### Attributes |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As this isn't included in API
, should not this be only mentioned later?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
They feel like individual sections that can live on their own, I'm not sure there's need to follow "API" with only the modules that it includes, since you can navigate up/down via the links/anchors under the API section to learn more about the individual ones?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
IMO, a beginner will likely read this in order, so I'd love if the most common things appeared first in the document.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great work!
What do you think about adding a small section on how to customize the url that will generate the ActionView helper related to that model? I have seen that need when you have the model in a namespace, something like Student::Application
, but for some reason you need the path to simply point to application (/applications/..., etc).
I don't know if there is a more idiomatic way to do it than this:
class Student::Application
include ActiveModel::Model
...
def self.model_name
ActiveModel::Name.new(self, nil, "Application")
end
end
Or maybe it's something very specific.
Co-authored-by: Bruno Prieto <brunoprietog@hey.com>
Co-authored-by: Juanjo Bazán <jjbazan@gmail.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Really nice work @Ridhwana. I had some last minute bits of feedback on a final pass, let me know if you have any questions.
Co-authored-by: Carlos Antonio da Silva <carlosantoniodasilva@gmail.com>
Co-authored-by: Carlos Antonio da Silva <carlosantoniodasilva@gmail.com>
Co-authored-by: Carlos Antonio da Silva <carlosantoniodasilva@gmail.com>
Co-authored-by: Carlos Antonio da Silva <carlosantoniodasilva@gmail.com>
Co-authored-by: Carlos Antonio da Silva <carlosantoniodasilva@gmail.com>
Co-authored-by: Carlos Antonio da Silva <carlosantoniodasilva@gmail.com>
Co-authored-by: Carlos Antonio da Silva <carlosantoniodasilva@gmail.com>
Review the Active Model Basics guide. Add `Attributes` and `AttributeAssignment` sections. Update the rest of the sections by trying to provide more information, be more clear, and include more examples. In some parts, it references the API where more information about the methods can be provided. Expand `ActiveModel::API` and `ActiveModel::Model`, reorganize sections to a more sensible order. Co-authored-by: Carlos Antonio da Silva <carlosantoniodasilva@gmail.com>
Review the Active Model Basics guide. Add `Attributes` and `AttributeAssignment` sections. Update the rest of the sections by trying to provide more information, be more clear, and include more examples. In some parts, it references the API where more information about the methods can be provided. Expand `ActiveModel::API` and `ActiveModel::Model`, reorganize sections to a more sensible order. Co-authored-by: Carlos Antonio da Silva <carlosantoniodasilva@gmail.com>
Motivation / Background
This Pull Request has been created to update the Active Model Basics Documentation.
Detail
This Pull Request adds the following two sections:
It updates the rest of the sections by trying to provide more information, be more clear, and include more examples. In some parts, it references the API where more information about the methods can be provided.
I also addressed these as part of the changes:
Checklist
Before submitting the PR make sure the following are checked:
[Fix #issue-number]