Ruby On REST 6: Pagination With Roar

{{{ Yo! How’s it folks? Let’s do some more REST today. I’d like to show how easy it is to have paginated REST documents with “Roar”:https://github.com/apotonick/roar while using a nifty feature introduced “in version 0.10.2”:https://github.com/apotonick/roar/commit/46fb88d1a79338188a9d05d353fc721d6a058e4e. h3. What’s In That Fruit Salad, Sir? Since we keep having fruit salads “in the last posts”:http://nicksda.apotomo.de/2012/03/ruby-on-rest-5-learn-hypermedia-by-making-fruit-salad/ I wanna write… Continue reading Ruby On REST 6: Pagination With Roar

Roar 0.10 with JSON-HAL Support and Representable 1.1.6 Released

{{{ Just a quick round-up for new things in the “Roar”:https://github.com/apotonick/roar world. Here we go! h3. Roar Speaks JSON-HAL Now! In the last “Ruby on REST post”:http://nicksda.apotomo.de/2012/03/ruby-on-rest-5-learn-hypermedia-by-making-fruit-salad/ I explained the basics of the hypermedia type “HAL”:http://stateless.co/hal_specification.html which *gives your document nesting and linking* semantics. This promising format is now supported by Roar. By including the… Continue reading Roar 0.10 with JSON-HAL Support and Representable 1.1.6 Released

Ruby on REST 4: Using Representers in Rails

{{{ It has been a while since I blogged about “Roar”:https://github.com/apotonick/roar and it’s representers – “beautiful South Africa”:http://rubyfuza.org/speakers?page=2 kept me from doing my homework. Nevertheless, in the meantime, the new “roar-rails gem”:https://github.com/apotonick/roar-rails emerged bringing together Rails and Roar in a very easy going way. I’d like to describe how this gem works by implementing a… Continue reading Ruby on REST 4: Using Representers in Rails

Ruby On REST 3: One Model, Multiple Representations!

{{{ Happy New Year to all my fellow readers! I hope you had a good party! In this post I wanna clarify why “representers in Roar”:https://github.com/apotonick/roar are much more versatile “than one might think at first sight”:http://nicksda.apotomo.de/2011/12/ruby-on-rest-introducing-the-representer-pattern/#comment-5346. h3. Model != Resource I know, Rails teaches us that every resource is a model with exactly one… Continue reading Ruby On REST 3: One Model, Multiple Representations!

Ruby On REST 2: Representers and the DCI Pattern

{{{ We “talked about Representers earlier last week”:http://nicksda.apotomo.de/2011/12/ruby-on-rest-introducing-the-representer-pattern/. Today, I wanna describe DCI and how it fits perfectly together with representers in “Roar”:https://github.com/apotonick/roar. h3. What is DCI? For years we’ve been taught that “Fat Models, Skinny Controllers” is the way to organize code. Push all your domain code into your ActiveRecord classes. “Many people”:http://qualityonrails.com/archives/33, including… Continue reading Ruby On REST 2: Representers and the DCI Pattern

Ruby On REST: Introducing the Representer Pattern

{{{ This post introduces the new “Roar gem”:https://github.com/apotonick/roar, a framework-agnostic REST framework for Ruby that puts focus on object-oriented REST documents. *More object-orientation?* The calls for more object-orientation in Ruby frameworks are growing ever louder. Most web frameworks, like Rails, come with a nice database abstraction, a Rack-like HTTP endpoint, routing, and a template engine.… Continue reading Ruby On REST: Introducing the Representer Pattern