Whether you’re using one of the many third-party analytics tools for tracking user events, or you’re implementing an activity stream on a social site with something like public_activity, at some point in your rails career you’re going to want the server to log events when certain parts of your business logic code fire.
Most tutorials and README files for server-side event tracking libraries will have you track events in your controllers, but sprawling controller methods that do too many things — update state, implement business logic, and track events — are one of the worst aspects of rails programming.
Thankfully, there’s a better way.
I used to think Google’s plan to give the world Internet via balloon was kind of looney. Then I moved to Texas and started a small hobby wireless ISP (WISP). Here are some things I learned about why American broadband is a fiasco, a fiasco that’s about to get way worse.
I needed to renew an SSL certificate today, so I used it as an excuse to try Let’s Encrypt for a free certificate for a Rails app hosted on Heroku.
Back when I started working with rails, a typical rails app was a relational database that you provided a user-facing CRUD interface for. Now a typical rails app is a place where a bunch of REST APIs meet. When talking to a REST API, most of the time it’s best to just use REST and avoid third-party attempts to map API calls onto a subset of magical ActiveRecord functionality. Here’s an example of that philosophy in action with the Uploadcare service.