View Components in Rails
summary
Argues that object-like view components replace sprawling partials and before_filters, using Merb Parts, Rails Parts, cells (app/cells generators) and Apotomo for interactive widgets; shows a speaking_events cell with show/head states, per-item and per-state fragment caching and explicit cache keys, generators creating app/cells and test helpers, and widget trees for notes with AJAX-driven create/update events. Demonstrates production use on democracynow.org and a Rails 3.1 app where components render, cache and nest successfully, reducing controller bloat while keeping CSS/JS placement as a noted caveat.
AI-written summary · about
chapters (6)
- 0:00Start
- 1:34render_component
- 3:24View Directory Structure
- 11:43How do we handle this?
- 22:35Caching
- 30:55Apotomo - Events
related talks
31mComponent Driven UI with ViewComponent gem
34mViewComponents in the Real World
57mViewComponents in the Real World
39mComponent Driven UI with ViewComponent
33mRefactoring Volatile Views into Cohesive Components
37mEncapsulating Views
40mBlow Up Your Views
32mComponent-based Architectures in Ruby and Rails
