Daniel Schierbeck
A9cc05e6a7866e5fa9a7d107b5070174?d=retro
Ranked 84 in Phase 1 with 69 unique views, 10 counted upvotes and 20 counted downvotes

Curly — Refactoring the view layer

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. While 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.

Curly is a project that aims to bring a simple, powerful, and clean view layer to your Rails apps, by completely separating structure and logic while integrating with Rails. By writing all your view logic in a plain old Ruby class, you get back all the powerful means of refactoring and improving your code.

Curly is open source and available at http://github.com/zendesk/curly


Previous Next

Suggestions

  • The proposal author responded 8 months ago

    Clemens: Curly basically brings the paradigms from Mustache/Handlebars to Rails in a consistent and Rails-like manner. If you're deeply familiar with those technologies, the talk will mostly be an introduction to Curly. I expect that most people are not that versed in Mustache/Handlebars, though. Curly has brough real and very visible improvements to the app we're working on, and the split between structure and logic that Curly enforces enables all sorts of cool things, caching being one.

    Nikos: it will focus mostly on the underlying paradigms, and how classic OO techniques can be utilized to improve the view layer.

  • 5976001c9ebf095c4988855a4e102de5?d=retro Clemens Kofler suggested 8 months ago

    Curly looks to me like Mustache/Handlebars + enforced presenter pattern – which is, of course, a good thing but in my opinion neither very new, nor very difficult, nor very interesting.

    Why should we vote for this talk? What will be in the talk that can't be taken straight from the README? What will be new for conference attendees who are (deeply) familiar with Mustache/Handlebars and the presenter pattern?

  • 59bbe3780ec28c45b4945f00435efeb3?d=retro Nikos Dimitrakopoulos suggested 9 months ago

    So is this presentation a demo of curly or something more like explaining a different paradigm for the view layer?