Talks
Speakers
Events
Topics
Sign in
Home
Talks
Speakers
Events
Topics
Leaderboard
Use
Analytics
Sign in
Suggest modification to this talk
Title
Description
Whether you're new to Rails or have been around few years, chances are that your views are primitive. Detonate what you know about how views are written and let's start over. In this session we'll discuss... - Why your views suck - Instance variables are stupid - Kill helpers and work with objects - Drawing the line between "C" and "V" - Treating views as API customers - Rethinking templating By the end you'll be dying to blow up your views. Help us caption & translate this video! http://amara.org/v/FGa0/
Date
Summarized using AI?
If this talk's summary was generated by AI, please check this box. A "Summarized using AI" badge will be displayed in the summary tab to indicate that the summary was generated using AI.
Show "Summarized using AI" badge on summary page
Summary
Markdown supported
In the talk titled "Blow Up Your Views," Jeff Casimir challenges Rails developers to rethink their approach to view layers in a Rails application. He begins by asserting that most developers' views are outdated and oversimplified, having undergone little innovation over the years. Casimir discusses the blending of multiple languages within the view layer, such as Ruby, HTML, CSS, and JavaScript, and criticizes reliance on instance variables that complicate the sharing of context between controllers and views. He advocates for a shift towards a more object-oriented design, suggesting that methods should be used from models rather than cluttering views with procedural helper methods. Key points include: - **Instance Variables**: These are often misused and lead to complex, coupled code that is hard to maintain. Casimir suggests eliminating them through cleaner interfaces. - **View Models**: He proposes using view models or decorators to manage presentation logic, which allows methods to be attached to models and makes the responsibility clearer. - **API-centric Design**: Views should be treated as API consumers. Casimir emphasizes that separating data gathering from presentation improves the ability to respond in multiple formats and reduces processing on the server side. - **Separation of Concerns**: By encapsulating authorization and presentation logic within decorators, individual views can adapt based on user permissions, promoting better organization and reusability. - **Performance Improvements**: Rethinking how templates interface with data can significantly enhance server performance, particularly when managing high volumes of requests. Ultimately, Casimir encourages developers to throw out outdated practices and adopt a more structured, object-oriented approach, utilizing decorators and clear interfaces to improve their view layers. He concludes with a call for questions and emphasizes his teaching capabilities in Ruby and Rails, inviting further discussion.
Suggest modifications
Cancel