A companion Rails app to Refactoring Volatile Views into Cohesive Components talk.
Examples of three different types of view components:
- Utility:
AlertComponenthttp://localhost:3000/alerts - Layout:
PageLayouts::BasicComponenthttp://localhost:3000/page_layouts - Model-Specific:
ContactCardComponenthttp://localhost:3000/contacts
See the progression of a tabbed navigation bar:
Then compare the final implementation with ViewComponent and traditional Rails view partials and helpers.
- ViewComponent: http://localhost:3000/tabs/c
- Partials & helpers: http://localhost:3000/tabs/p