Skip to content

Emery's Insights

Good Coding Practices, Software Design, and the Software industry.

Archive

Category: Ruby On Rails

Learn how to make less obtrusive login prompts in Rails apps with AJAX that continue the action that triggered them.

How to decide whether to extract common/similar view code into partials or helpers?

conflict_warnings is a Ruby on Rails plugin I wrote that addresses the shortcomings of optimistic locking when dealing with user actions that span multiple HTTP requests.

Rails provides optimistic locking as a method of ensuring that multiple changes to the same record at approximately the time do not clobber each other. The method that Rails sever uses to handle requests, renders optimistic locking useless in situations where it’s most needed.

I patched CollectiveIdea’s acts_as_audited Ruby On Rails plugin to include audit comments. A blog post about a fork isn’t the proper way to get your work accepted upstream. But the project maintainer doesn’t have the best track record with pulling from the community, and I felt this was worth sharing. Read on for Installation and usage notes.

This distinction between Model, Controller and Observer is just a case of splitting hairs over semantics. There are valid arguments for it to go in either of the three spots. My opinion is that mail delivery belongs in an Observer.