Major Ruby on Rails upgrades can be a headache when your project has a lot of dependencies or gets too far out of date. I’m pretty new to the Ruby and Rails ecosystems. And when I had to perform upgrades on several projects recently, I was disappointed by the lack of guidance available. To be […]
At some point, you may need to create custom forms in Active Admin for admin users to create records. Active Admin uses Formtastic, a FormBuilder DSL, to output these forms. In this post, I’m going to show you some of the things you can do with them.
Active Record is a popular Object Relational Mapping system (ORM) that many web developers find themselves using at some point or another. A lot has been said about the benefits and drawbacks of ORMs in general, and Active Record shares all of them. Regardless of how you feel about it, using Active Record will be […]
After a long hiatus from Rails, I found myself working in a Rails codebase this week. Here at Atomic, our recent focus has been on the wins provided by our starter kit. I still love Ruby and Rails, but after digging through a well-intentioned codebase, I was reminded how much I dislike Rails magic callbacks.
Rails and Active Record make many things easy: connecting to the database, building complex queries based on your object model, and easily migrating your schema up, down, and sideways. They also let you very easily introduce N+1 queries.
Security Assertion Markup Language (SAML) is a protocol for single sign-on. SAML handles communication between a service provider (SP) and an identity provider (IdP). The identity provider acts as an authentication and identification mechanism for service providers. In this post, I’ll walk you through setting up your Rails application as a SAML IdP. This post […]
It seems that on every Rails project I work on, I end up writing utility scripts that make changes to the production data in some way or another. Perhaps it’s pre-loading hundreds of user accounts for a customer that wants to provide a spreadsheet of users, or populating an account with fake data that can […]
I was recently working on a piece of code from a legacy Rails application. An unusually large number of queries being run on a particular page let me know there was an N+1 query lurking. The application was an online assessment platform dealing with assessments, questions, and responses. The question listing page was simply asking […]
Heroku provides a convenient command line interface for executing snippets of Ruby code remotely. One-liners can easily be piped into the heroku run console command. But what about much longer scripts that you write locally and want to execute in a remote Heroku environment? In this post, I’ll show you how to execute a long […]
Active Admin is a fantastic library for building an administrator interface for a Rails application. Not only does it make creating CRUD pages incredibly simple, but it also allows for custom views–something I discovered recently when I needed to create a dashboard page that included several charts.