Quick Thoughts...

Rails’ Partial Features You (didn’t) Know

Partials have been an integral part of Rails. They are conceptually simple to understand, but they pack quite a few smart and lesser known features you might not know about. Let’s look at all of them!

#

Keynote

A presenter is an object that encapsulates view logic. Like Rails helpers, presenters help you keep complex logic out of your templates.

This thing has barely seen an update in years but still works just as you would expect. It is likely the closest thing to done in my Gem file.

keynote: Flexible presenters for Rails.

#

Kudos for the super helpful error message:

constraints

I have a constraint on the route, and I was passing "posts" instead of "posts.

delete "/orphans/:type/:uid", to: "orphans#delete", as: "delete_orphaned_items", constraints: {type: /(post|page)/}
#

Introduction to Minitest Mocks

Test doubles likes mocks and stubs can help us with isolating code under test with the rest of the system. Here’s how to mock in Minitest.

#

It hurts my feelings when one flaky system test causes the whole bar to turn red.

flakey.png

#

Charlie Munge:

The world isn't driven by greed. It's driven by envy.

#