Annotate - Adding Table Columns to Model File Automatically
Adding table column comments to a model file can be a chore, especially making sure they’re kept up to date as your schema changes over time which is especially important since out of date information is worse than no information at all. This is wher
Read more
Generating a CSV file to export records in Rails
CSV (comma separated values) files are a great way to export a collection of records for importing into other systems or for analysis of data. Here we’ll be exporting the records for a table that has a single has_many
relation.
The Pessimize Gem - Assigning a version to all gems in Gemfile
It’s always a good idea to assign versions to all you gems in your Gemfile. Personally I’d say it’s absolutely mandatory and not assigning at least a major version should throw an error, but that’s not up to me which is probably for the best.
Read more
Overriding to_s - Inserting a model directly into a view
<%= @foo %> => #<Foo:0x007fa874102948>
How to make your URLs pretty with friendly_id in Rails
Replacing record IDs in your URLs with the name of your record is incredibly useful for SEO purposes as well as making the links people share more descriptive and self-explanatory.
It’s also very easy using the friendly_id gem.
Read more
Adding Pagination to an ActiveResource Backed Controller
We’re going to add Pagination to an ActiveResource model using activeresource-response
for handling ActiveResource response headers on the ActiveResource server side of things and kaminari
for handling the pagination on both the API and ActiveRes
RainBar - Raining on the desktop
I've always been a fan of the various background noise websites like Rainymood. Unfortunately I've never been a fan of having to keep a tab open at all times. Because of this I put together RainBar whilst learning how to make OS X apps last year.
Read more
Adding functionality to a gem - Creating a gem from scratch Part 3
This is part three of a series on creating your own gem. This part will cover filling in the functionality of our gem and installing it.
Read more
Adding specs to a gem - Creating a gem from scratch Part 2
This is part two in a series on building a gem from scratch. In this part we'll be adding the specs for our gem's functionality.
Read more