We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
Updated View Components (markdown)
Clarify that the presence of view component previews is now enforced with a custom RuboCop cop
Fix links to FAQ sections
Fix link to "Why view_component Instead of a Frontend Framework like React/Vue?"
Extend "Avoid Global State" examples
Add missing `a`
Follow upstream change "Rename private accessor rendered_component to rendered_content"
Add "Conditional Rendering" section
Remove unneeded empty line
Clarify how view component previews are named
Link to the custom RuboCop cop in the "Avoid Global State" section
Add section OBS Components Details
Clarify how data should be passed in "Avoid Database Queries "
Add "Avoid Database Queries" section
View components aren't only an alternative to partials, any view code which needs to be tested can become a view component
Add "Most View Component Instance Methods Can Be Private" section (copy-pasted from https://viewcomponent.org/viewcomponents-in-practice.html#most-viewcomponent-instance-methods-can-be-private)
Add "Avoid Global State" section (pretty much copy-pasted from https://viewcomponent.org/viewcomponents-in-practice.html#avoid-global-state)
Remove unneeded `.to_html` calls
Clarify distinction between built-in and custom helpers
Answer "Why view_component Instead of a Frontend Framework like React/Vue?"
Add answer to "Should We Migrate Existing Partials to View Components?"
Add TODOs to questions under Frequently Asked Questions
Add outline for "Frequently Asked Questions" section
The proposal for view components is out of RFC