When working on a Rails project, you will inevitably need to move data around in your database. Some join table value will need to be moved into its own table or what have you. When approaching these kinds of migrations, there are two major complications: future-proofing and testing. In this post, let’s walk through an […]
I recently came across a situation where I needed to be able to upload a file to a Rails server with Active Admin. I did a quick search on Google and found this post by Job, a fellow Atom. Our use cases were a little bit different, though. He was storing the file contents directly […]
ActiveAdmin has saved a huge amount of time on our current project, and I highly recommend it for quickly giving non-technical people administrator access to your Rails app. Some of the documentation is great, and there are lots of methods you can use to customize, but there are also some out-of-date red herrings, some things that […]
I recently wanted to be able to upload a small file and then store it as a field in the database via an Active Admin interface in a Rails app. The solution is pretty simple, but it was tricky to figure out. In my case, the file was a small piece of firmware. For this […]
For me, one of the most frustrating parts of being a software developer is trying to wade into an existing project that’s unfamiliar to me. It’s particularly hard with an unknown language, platform, or toolset, but even if you know the language and platform, a new app can still present a challenge. When working with Rails […]
My distaste for unnecessary Rails controllers is no secret. That’s why I wrote the ddc gem (Data Driven Controllers). When DDC was released, it got mixed reviews in the comments section, so I thought I’d post a follow up with my results thus far.
Ruby on Rails comes bundled with several validators for its models. They’re used for ensuring that the data structure of the application matches the business logic of the application. There are several built-in validators that can be used to make sure that certain properties about the model are true before they are saved—and it’s easy […]
We’re using the CanCanCan authorization gem to control access to resources in our current Rails project. It’s a great way to get started and covers a lot of ground with its basic and extended syntaxes, and it has decent support for adding more complex permissions checks that may not fit into more conventional patterns. It’s […]
Writing Rails controllers can be a pain. They exist in a weird transitional point in your application, facilitating communication between the world of hypertext, headers, and response codes (Railsy code) and your application domain.
Localization is a complex matter in software development, and it is usually put off as a clean-up task at the end of a project. Content translation is usually contracted out and performed by non-developers, so there’s also a technical gap to overcome. After battling Qt translations for months on a previous project, I created the AnnoTranslate Rails […]