2 followers
Hone your Ruby on Rails craft. Tips, tricks, and articles from a professional engineer with 10+ years of experience.
If you have two or more render statements in your controller action, you might consider extracting some of the logic into a before action. Why?...
In software development we’re often given advice in absolute terms: “Service Objects are an anti-pattern.” “Keep your controllers skinny.” “Vanilla...
Anytime your controllers start to accumulate non-standard CRUD (Create, Read, Update, Delete) action names, you may consider extracting the action...
💡 Trigger Warning! This approach may be considered controversial, especially since it touches on using exceptions for control flow. This is a...
Did you know you can set controller-specific middleware in your Rails controller with the use method? I found this while looking through the docs for...
Recently, we were trying to write a similarity(...) query in Postgres, and needed to pass in a parameter into a SELECT clause. Brakeman came back...