Videos

Rubyfuza 2014

Videos provided by Rubyfuza Conference via their YouTube Channel

While most parts of Rails have been thoroughly overhauled during the past few years, one part has stubbornly refused improvement. The view layer is still by default using ERB to transform your app's objects into HTML. Though HAML has gained a lot of traction, it is not a fundamental shift away from ERB, but rather a preference for putting HTML in your Ruby rather than the other way around. More recent efforts in the realm of JavaScript have produced Mustache and its ambitious younger brother, Handlebars. While these are more radical in their attempt to separate structure and logic, they still do not feel like native Rails code. While trying to solve a seemingly unrelated problem we discovered a design that suddenly enabled us to move past the limitations of ERB. Though different only in subtle ways, it struck just the right balance between integration with Rails and separation of concerns. We called it Curly. I will show how we use the same old OO techniques that you already know to clean up our views, making them less prone to bugs, more readable, and more reusable. I'll also show how a seemingly small change of our conceptual model enabled us to add advanced behavior to our view layer without ending with an unmaintainable mess. Curly is open source and available at http://github.com/zendesk/curly

Rated: Everyone
Viewed 266 times
Tags: There are no tags for this video.