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] Action View Helpers Documentation [ci-skip] #51432
Merged
carlosantoniodasilva
merged 89 commits into
rails:main
from
Ridhwana:Ridhwana/action-view-helpers-documentation
Apr 9, 2024
Merged
[RF-DOCS] Action View Helpers Documentation [ci-skip] #51432
carlosantoniodasilva
merged 89 commits into
rails:main
from
Ridhwana:Ridhwana/action-view-helpers-documentation
Apr 9, 2024
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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>
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>
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>
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>
p8
reviewed
Apr 8, 2024
Co-authored-by: Petrik de Heus <petrik@deheus.net>
Co-authored-by: Carlos Antonio da Silva <carlosantoniodasilva@gmail.com>
Co-authored-by: Carlos Antonio da Silva <carlosantoniodasilva@gmail.com>
@carlosantoniodasilva, @brunoprietog and @p8 thank you for the feedback 🎉 I've accepted the suggestions, and made some additional changes that were discussed in the thread that can be found here and here. |
carlosantoniodasilva
force-pushed
the
Ridhwana/action-view-helpers-documentation
branch
from
April 9, 2024 13:17
481f589
to
945306a
Compare
fractaledmind
pushed a commit
to fractaledmind/rails
that referenced
this pull request
May 13, 2024
Review and improve the Action View Helpers guide. - Reorganize sections, in most cases moving most commonly used helpers up, grouping some of the formatting ones together - Expand with more examples and a few new methods - Link back to the API of each helper whenever possible - Remove WIP Co-authored-by: Carlos Antonio da Silva <carlosantoniodasilva@gmail.com>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Motivation / Background
This Pull Request has been created to provide clarity to the Action View Helpers guide.
Detail
Here are some notes on what has changed:
Some notes:
AssetTagHelper talks about a bunch of *_tag helpers, but also some of them mention *_url and *_path helpers. (which live in AssetUrlHelper). Those are helpful to know, but less frequently used I think. It's also incomplete (some mention it, others don't, *_tag helpers have their _url/_path counterparts, or use the basic
asset_path/url
.) I don't think it's worth expanding with all these variants, I'd rather remove the individual ones, and if we want to mention, we can maybe bundle them together within the same subsection instead, or just as examples of the related *_tag sections.The cache helper could use some more info. I don't think it's worth linking to the Fragments API, but rather to the fragments caching piece of the caching guide, where it goes into more details. The example could also be expanded to show something that at least gets a record as an example too.
content_for
could perhaps benefit from showingcontent_for?
in the example, somehow.We do not want to show any form helpers here, just link to the specific guide, but we can maybe make that paragraph clearer.
escape_javascript
could use an example (not the one that's on the API as it seems very jquery-related... maybe some other example of embedding some Ruby in JS or something)mention of
rails-html-sanitizer
could be linked."NB: The output may still contain unescaped '<', '>', '&' characters and confuse browsers." should be a note?
UrlHelper could have a few extra items like
current_page?
andmail_to
, which can be commonly used. (no need to show each and every method, just the most common ones)CsrfHelper seems unnecessary to explain here. (we don't add CspHelper for instance... not sure we need to get into those, can probably skip them.)
We could have a section on
TextHelper
mentioning things likesimple_format
,truncate
,excerpt
, maybe some other(s). (again, not everything, just the most commonly used ones)We could have a section on
TagHelper
mentioningcontent_tag
andtag
.Updated the 'what you will know section'
Formatted all sections to be similar where there is some description under the helper and then we get into the methods
Column count adherence.
Removed Benchmark that was deprecated
Made tweaks to language and clarity.
Added more clarity to
capture
andcontent_for
Added more examples where necessary.
Remove WIP from index page
Rearranged the sections
Additional information
Checklist
Before submitting the PR make sure the following are checked:
[Fix #issue-number]