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

Why Is The Representer Called Representer?

{{{ A number of users (hundreds, maybe thousands) have been asking why representers are called representers and not “representations”. It is a valid question and since I spent decades to come up with this term I’d like to discuss the decision here quickly. h3. What Is A Representation? A representation in the REST style –… Continue reading Why Is The Representer Called Representer?

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 5: Learn Hypermedia By Making Fruit Salad

{{{ Let me start this post by quoting something smart. “REST [is an] architectural style for distributed hypermedia systems” That actually is the “first line, chapter 5”:http://www.ics.uci.edu/~fielding/pubs/dissertation/rest_arch_style.htm of Roy Fielding’s thesis about REST. I gave a couple of talks last year about hypermedia and the misunderstandings in REST in the Rails world and this post… Continue reading Ruby On REST 5: Learn Hypermedia By Making Fruit Salad

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

Rails Misapprehensions: Query Parameters are RESTful

{{{ We were discussing the *design of search resources* in a REST architecture after the REST talk at the EuRuKo. Usually, search resources process GET requests, compute a subset of searched items and return a representation of the respective items. The following GET request illustrates this. http://articles/search?type=shirt&color=red&size=s It’s absolutely common to allow more parameters. http://articles/search?type=shirt&color=red&size=s&… Continue reading Rails Misapprehensions: Query Parameters are RESTful

Representable gem released: Improve your REST representation code!

{{{ The “representable gem”:https://github.com/apotonick/representable helps to keep parsing and rendering representations in one place. Once defined, it gives your model @#to_xml@, @#from_xml@ and more. The initial version was released today, let’s see how it helps *cleaning up your representation code*. h3. Let’s write a Blog app! Since your imaginery blog app has a REST API… Continue reading Representable gem released: Improve your REST representation code!