rails

When you can’t use cookies

2 minute read

So, I’ve looked at the utility and security of cookies and I’ve at looked the utility and security of sessions. It you’ve been following along, then you know...

Capistrano SSH

2 minute read

A quickie this time. I use Capistrano to deploy my Rails apps. There was a gem for Capistrano 2 that added an ssh command as in:

Rails in Session

4 minute read

Last time I took a reasonably deep dive in cookies. Cookies can keep state information and setting for visitors to a site. However, by default they aren’t se...

C is for (HTTP) Cookies

4 minute read

I’ve been working on a post about using JWTs JSON Web Token (JWT) when you can’t use HTTP cookies for sessions. As I dug into it, I came to realize that unde...

Secret Rails Configurations

2 minute read

Last time, I looked at keeping environment specific configuration using YAML files and Rails.application.config_for. One big issue with this approach is secu...

Custom Configuration for Rails Environments

3 minute read

Previously, I looked at the simply way of creating Rails stages that shared same configuration with Production by simply importing production.rb into the new...

Quick and Dirty Rails Environments

1 minute read

A quick tip — When I’m deploying Rails apps to Staging or Beta I try to keep the configuration as close to Production as possible. I’ve gotten bitten one too...

Importing Legacy Data into Your Rails App

3 minute read

Sometimes you have to write a new Rails app for old data. One approach is to keep the old format and carefully craft your ActiveRecord models to work with th...

Getting the ngrok URL

less than 1 minute read

A quick addendum to my previous ngrok post. If you are not using subdomains, it can be useful for your app to know what ngrok’s dynamically generated URL is....

Autostart ngrok with Rails

2 minute read

I’ve been using ngrok on quite a few projects lately. I’ve written about it before, but in short, it solves to problems for me.

How I Start Rails Projects

3 minute read

Everyone has their patterns, here’s mine for starting a new Rails project:

Get the MIME Type of a Random Upload in Rails

1 minute read

It’s surprisingly hard to find info on getting the MIME type of a file in Rails. Rails has MIME::Type (and the confusing and undocumented MIME::Types). You c...

Getting Uploaded Data Out of AWS S3

3 minute read

OK, so you know how to get data into AWS S3, what about getting it out? Previously, we uploaded entries from an imagined photo contest into a bucket. We sent...

Direct to S3 Uploads with AJAX Presigning

3 minute read

Previously, I covered uploading to S3 from a Rails app using a presigned-url. This works just fine, but means the data flows from the visitors computer to yo...

Tunneling to Localhost

4 minute read

When you’re developing Rails apps or pretty much any other framework you can name, you typically work with a server running on localhost. This is all well an...

The Sekrets Gem

2 minute read

I occasionally write about encryption in Ruby, yet somehow I haven’t managed to cover my friend Ara’s Sekrets gem.

Validating Rails Forms “without” a Model

1 minute read

Sometime I want all of Rails’ form bells and whistles for something that isn’t a database backed model. For example, I use this as a handy way to get form va...

(Symmetric) Encryption with Ruby (and Rails)

5 minute read

I wrote and maintain (though not as attentively as I’d like) a Ruby Gem, Strongbox, which adds Public-key Encryption support to Rails’ ActiveRecord. Simply p...

It’s in the Logs, Stupid

less than 1 minute read

Yesterday, I was involved in a fire drill around the launch of a new Rails site on a very tight time frame. The site worked fine in development/staging, but ...

Dynamic Keys for Strongbox

1 minute read

Previously, Strongbox, my gem for using Public Key Encryption with ActiveRecord, allowed only one key pair for encrypting all of the records for a given Acti...

Introducing Strongbox

6 minute read

Over a year ago I wrote the wildly popular Encrypting Lots of Sensitive Data with Ruby (on Rails). At the end I said: Clearly, this screams for a plugin; w...

Encrypting Sensitive Data with Ruby (on Rails)

2 minute read

In Encrypting Sensitive Data with Perl I wrote about how to use public key encryption to automatically and securely encrypt information with Perl. This allo...