Know what errors lurk in your code? Rollbar detects and alerts you when code breaks in production. Get the stack trace, code, and data to help you d̶e̶b̶u̶g̶ defeat Ruby errors. Learn more.

RubyFlow The Ruby and Rails community linklog


The Ruby and Rails community linklog

Made a library? Written a blog post? Found a useful tutorial? Share it with the Ruby community here or just enjoy what everyone else has found!

How to decrease coupling in your controllers & views with decent_exposure for better maintainability

I wrote up a detailed post about the decent_exposure gem. It goes into how controllers and views have strong coupling due to the passing of instance variables. The rest of the post details how you can use decent_exposure to cleanup your controllers.


This is in my opinion the most important Ruby Gem of all time. It cleans up your controllers greatly and just makes life more pleasant. Thanks for this article on it, I hope it helps bring more attention to decent_exposure.

I forgot I had actually written a post about decent_exposure myself. Read it here

We took this a bit further - defined a simple ‘decorate’ method which a decoration wrapper around ‘expose’ method. Now every time we are exposing something we are also decorating it. Checkout here:

My friend created a gem for this decent decoration ‘pattern’ we invented:

Post a comment

You can use basic HTML markup (e.g. <a>) or Markdown.

As you are not logged in, you will be
directed via GitHub to signup or sign in