RubyFlow : The Ruby Community Blog

Home   Submit   Sign Up   Log In   leaders   Twitter   RSS Feed  

apotonick — 87 posts

Roar is a framework for rendering and parsing REST documents using representers. The 1.0 release comes with full JSON-API support. Read my blog post for a quick intro to JSON-API and how Roar makes it super simple to use this media format in your applications.
Reform 1.2 Is Out!
The popular form object for Ruby and Rails, Reform, got some new amazing features. It now allows dynamic syncing and saving, got a 85% speedup, a dirty tracker and more.
Trailblazer introduces several new abstraction layers into Rails. It gives developers structure and architectural guidance and finally answers the question of "Where do I put this kind of code?" in Rails. My book's first sample chapter is available now as a free download.
Representable 2.1 Is Faster!
The new representable release allows to skip rendering and parsing of properties dynamically. This allows to exclude properties at run-time, e.g. to reflect permission restrictions. It also got faster and we added a debug mode to help understanding what Representable does internally.
Paperdragon is a new alternative to Paperclip and CarrierWave. Its very explicit API uses Dragonfly under the hood and gives you control about every aspect for processing uploaded images.
The 1.1 release of Reform brings better reusability for DRY form objects, simplifies and fixes lots of things and allows deserializing JSON and more, to make forms part of your HTTP API, too.
The new Cells view model allows replacing helpers and partials with a clean, encapsulated component by introducing a badly needed new abstraction layer.
Kaminari-Cells Is Ready!
The new kaminari-cells gem allows using kaminari's pagination in cells.
Representable is a mapping gem to transform Ruby objects to and from hashes, JSON, XML, and YAML. This blog post explains the new features in the 2.0 release.
Following a progressive path when developing gems and following semantic versioning results in fast-growing major version numbers. With two examples I explain my dilemma and open the discussion for proper versioning of Ruby gems.
Cells now allows to package JS, CSS and more into a cell directory making it really simple to integrate assets into the asset pipeline. This allows a highly modular and encapsulated architecture which is briefly discussed here.
SRP is, hand in hand with MVC, Decorator, and SEO, one of the most misunderstood concepts in the Ruby community. In a quick post I describe what SRP means and how you can use it when designing APIs.
The Reform gem turned 1.0! Its popular form objects have been simplified , the public API reduced and new features like automatic populating have been added. The new exciting Reform::Contract layer helps you decoupling persistance from validations - for good! Read the blog post here!
Cells is a popular view component gem for Rails. The latest 3.10 release changes the API slightly - read the blog post for a discussion on cell caching and the changes.
Representable helps you rendering and parsing API documents. Mapping deeply nested documents to flat objects has been a bit of a pain. A new DSL method simplifies that in an enjoyable way.
Roar Got Better Http Support!
Roar 0.12.3 comes with HTTPS and basic auth support for client representers, as well as a simpler API for dealing with HTTP - read about it here.
Finally, the Roar README got completely rewritten - it now covers all the aspects as the underlying representable gem, rendering and parsing REST representations, nesting, coercion, HAL and Collection+JSON, client-side support and a lot more.
In Cells 3.9.0 we introduce view models to bring helpers back to object-oriented scope. We also introduce a new DSL to make it easier working with cells.
Reform is a form object gem that decouples your forms from your models. We're happy to announce version 0.2 with support for nested forms to handle has_one and has_many associations in a database-agnostic way.
The mapping gem representable got support for syncing objects when parsing REST documents and some more awesome features, read the release blog post to learn more about it.
Nit Improves Your Git Workflow.
Nit was planned to save me from having to copy&paste file names when commiting with git. It's now a handy tool helping you with your everyday git and worth a look.
Hooks Got Better.
The hooks gem gives your objects simple hooks with callbacks. In the new 0.3 version we added some features like callback chain halting.
Reform gives you a form object that decouples your form from the database. It gives you all the goodies as validation and parameter filtering while working with all form rendering engines like simple_form. Here's the story.
Roar and Representable got decorator support for all those who didn't like the extend way of creating and parsing representations.
The new release of roar-rails allows you passing user options to #respond_with and #consume! Also, overriding reading and writing of document fragments in representable is now easily achieved, but, hey, read the whole story here.
Cells Got content_for Support.
Since many users asked for it the cells gem got global content_for support.
Representable 1.3.3 got :setter and :getter to define accessors inline and process user options from outside! Heads-up here.
Roar, a REST framework gem, now comes with support for rendering and parsing the Collection+JSON format. Here's a litte introduction to Collection+JSON and how it works in roar.
Did you know that Nokogiri's xpath search is faster than your own? I didn't. Benchmark here.
The new Roar version now completely implements the HAL/JSON standard, including the long-awaited link arrays. Also, representer got some nice new features for polymorphism in your REST representations - check it out on my blog.
The representable gem got YAML support with flow-style lists, a hash representer for using forms and more. Where? Here!
The first post quickly analyzes the problem of growing "model" classes in Rails project. As we tend to mix persistance and domain the post wants to encourage you to introduce new classes when your models get bloated.
Have you ever wanted to use simple_form in a Sinatra app? The new cells version allows using Rails gems outside of Rails in any environment. And surprisingly this article describes how this works!
With the release of representable 1.2 - a gem to map (REST) documents to Ruby objects - some groovy things changed, like the treatment of nil and false values.
This brand-new post describes how to use Roar's representers and will_paginate to generate paginated REST documents. Also, we discuss how to move reusable logic into an abstract PaginationRepresenter.
We just married Virtus, a coercion gem, with the REST framework Roar. Check out how the automatic type conversion can help when parsing or rendering REST documents.
Roar 0.10 got support for HAL+JSON, a new promising hypermedia REST format. Representable 1.1.6 got the :if option for conditional representing properties. Read it here.
Discussing the concept of REST and hypermedia we learn what is a hypermedia type, why HAL+JSON makes our life easier and how to fix a yummy fruit salad.
Cells + Engines bring real reusability to Rails. And it's soo easy to distribute your cells between different projects.
The fourth post in the "Ruby On REST" series explains how the roar-rails gem helps using Roar's representers in Rails REST services. Following the fruit and bowl example it discusses how to parse and render REST documents in a Rails environment.
In the 3rd post of the Ruby on REST series we learn a bit more about resources and why and how one particular model can be represented in multiple contexts.
Check out what stuff we're planning for 2012 on the Cells project (Rails decoupling, alternate Tilt rendering engine, ...) and learn about the new cells-filters gem that brings together callbacks and state-args.
Cells 3.8 is out! Since we got rid of the ActionController dependency we can now mount cells on Rails routes, directly and have super fast view components.
Read about how DCI and Representers in Roar work together. The post briefly describes DCI in Ruby and Rails and how this can be used to write REST APIs.
A comprehensive introduction to the new Roar gem which puts focus on object-oriented REST documents with HATEOAS, hypermedia support, client and service usability, fast tests and saving the world.
Short post about the difference between assertions and expectations and why I started listening to Mock'n'Roll.
In this screencast we learn how to use the event instance as a messaging object between widgets and how to partially update the page without having to re-render the entire widget.
The current helper implementation in Rails is not good. This post explains why and how to get out of this misery using draper, cells and some different approach.
We just released the first working 0.9.1 version of apotomo-rspec that brings render_widget and trigger to your specs. Check out this brief walk-through.
Cells Cheatsheet 1.0 released
Finally, we got a cheatsheet for Cells, Rails' one and only view component and portlet framework.
Some say that you should only test your public API. I disagree officially in this blog post that shows pros and cons of testing private methods, too. I'd love to hear your opinions!
A discussion about the Dependency Injection pattern in Ruby/Rails, and the role of components in Rails.
Are Class Methods Evil?
Trying to figure out if class methods are evil, misused or just problematic when it comes to DCI. Please help me with comments (on the blog).
Long URLs and query parameters are nothing wrong in REST, however you're free to expose additional resources with dedicated URLs in your Rails project (or anywhere else). Read how resources, URLs and query parameters fit together and feel free to comment!
A quick summary of what changed in Cells 3.6 and how we support Rails 3.0 and 3.1 in one gem.
The third episode of the Apotomo screencasts explains how Ruby widgets can use event bubbling for building decoupled view components.
The first episode discusses the basics of Rails widget framework Apotomo: generating, rendering and event processing in widgets. Check out the 14 min. video here.
The representable gem helps to keep parsing and rendering representations in one place by letting you define mappings in your models (or anywhere else). This post briefly discusses how this works.
We released test_xml to help you testing XML with Test::Unit, MiniTest, RSpec and Cucumber. Here's an overview of the assertions and matchers making your life simpler.
My opinionated opinion about the on-going +1 discussion on Rails and coffeescript and a discussion what is an abstraction layer.
Working with resource representations is the hardest part about REST. This blog post discusses how Rails handles de-/serialization of representations, the limitations of the Rails way and the problems when cluttering transformation rules. It then introduces the new roar gem which tries to solve all that with representers and more.
The web component framework for Rails lost 50% of its core and still got better and simpler. Read here how it works.
Read and discuss view caching in Rails, the pros and cons of fragment caching, how Cells handles caching, and why we should put work into testing cache mechanics.
Find out what cool changes were introduced in the new Cells 3.5: We got better generators, state-args and rspec.
In my last article this year I explain the difference between POST and PUT by using the classical shopping cart example. Happy New Year to all you coders!
Rails 3.0.4 will have view inheritance. This post discusses how this advanced technique can help having cleaner views, how it works in Rails and how to get real object-oriented partials with inheritance and overriding.
After CRUD is not REST! I politely discuss what REST gives us beside CRUD: Unique resources, representations and content negotiation, hypermedia and HATEOAS.
Anybody so far wrote about developing rich desktop-like Rails applications so I posted this comprehensive guide about Rails and web components.
In the last post we wrote a sidebar widget which is now turned into a real AJAX widget using Apotomo, the one and only web components framework for Rails.
Just a brief tutorial on writing a sidebar widget for a Rails app without work-arounds like partials or presenters.
There's a lot of confusion about MVC and MVP, especially in Rails people try to break out from the monolithic MVC approach by using Presenters and Cells. Help me to clarify this pattern, read, comment, discuss and please insult me, again!
This nerd's tutorial helps understanding how Blueprint, Compass, SASS and Rails work together to make better-looking pages. It is addressed to non-designers like me.
MVC doesn't mean there has to be one monolithic controller to rule 'em all! Some people seem to confuse that, in this post I'd like to clarify what MVC really is and how it should be used in Rails.
DRY up your Rails views, man!
I wrote a real-world example why partials suck and how Cells kills the DoubleRenderError in Rails.
Here's a short discussion about the differences between CRUD and REST and how it helps understanding REST if you separate these two concepts.
Read how you should test your application test helpers and public test cases shipped with your gem here.
A step-by-step guide on testing your gemified Rails 3 engines using a dummy rails app with enginex. If you like it, comment and tell me you like it. If you don't like it, comment and tell me you don't like it.
What steps does it take to improve your architecture with Cells? This article discusses the best practices from keeping views dumb, via slim controllers, how to avoid messy helpers, through to hiding your caching strategy and component-oriented teams.
Hooks without ActiveSupport?
A vivid discussion about the benefits of ActiveSupport in gems lead me to releasing a new version of hooks without the ActiveSupport dependency. I'd love to hear your thoughts about the future of do-it-all ruby feature libraries like ActiveSupport (please comment on the blog post)
Cells are view components for Rails (somehow comparable to render_component, but awesome). We just released the stable version for Rails 3.
A small post how to use hooks, a new gem on the block. It shows how simple hooks and callbacks (like a before_filter) can be implemented or how you can improve your application code.
The first real explanation ever on how to write rails 3 generators and package 'em in your gem library along with rock-solid tests.
A great feature in Rails Cells is view inheritance, which helps keeping your views clean and DRY. It needed some publicity so I wrote a small article about it.
The framework providing a generic OOP helper API just got a binding for Rails. Go and read how to write those clean, aesthetic helpers in Rails.
ActiveHelper is a generic framework for writing clean helpers with defined interfaces. It is geared towards usage in frameworks like Rails, Merb, Sinatra or your own project. Check out my introducing blog post and yada yada.
Apotomo brings stateful components to Ruby and Rails. Finally we started a tutorial series showing all the bits and pieces of widget implementation, event triggering and handling, AJAX page updating and component-oriented architecure.
Check out this blog post if Ruby's Observable is not enough and you want generic mechanics for bubbling events in your Ruby objects. The gem's somehow comparable to JavaScript's event system but is pure Ruby, lightweight, simple, small and tested.