Otherwise known as… This post could also be called “Stuff I’ve figured out about Rails but didn’t want to blog about because I suspect everyone else already knows it and will figure out that I’m a moron”. A code picture is worth a thousand words Here’s some code. I’ve got some routes in there to […]
Entries Tagged as 'Uncategorized'
Conventional Rails
June 27th, 2013 · No Comments
Tags: Uncategorized
Adding Events to Various Calendars (Google, Live, Yahoo)
March 6th, 2013 · 3 Comments
Everything’s a nail In the past I’ve used a jquery plugin for generating links to add events to a calendar, but it recently broke when I upgraded jquery on TroopTrack. So I started banging around trying to get it to work for about an hour before I realized I was being stupid. The jquery library […]
Tags: Uncategorized
Useful Way to Automagically Add Controller/Action Selectors to an App
February 4th, 2013 · No Comments
Not Invented Here I swiped this idea from the work Craig Ulliott did on bodyshopbids.com. Thanks Craig! Don’t hard-code selectors for action and controller specific CSS and Javascript Sometimes you need a bit of CSS or javascript that only applies to a specific action, or maybe to every action on a controller. So, you go […]
Tags: Uncategorized
Getting Started with the AWS Elastic Transcoder API in Rails
January 31st, 2013 · 7 Comments
Elastic What? Elastic Transcoder is a brand new product from Amazon that lets you transcode videos into your favorite formats. It comes with lots of awesome preset formats, so you can use it through the AWS console to transcode a hi-def video to a web-friendly or iPhone-friendly resolution. You can even use it to create […]
Tags: Uncategorized
A Convention for Displaying Privileged Links
January 28th, 2013 · 4 Comments
I really hate view code like this: – if can_manage_users = link_to ‘Add a user’, new_users_path I want to get rid of it for a number of reasons, but the biggest reason is for cacheing. It really complicates my cacheing strategy because then I have to make keys that take into account the logged-in user […]
Tags: Uncategorized
Uploading Huge Files with Rails
January 27th, 2013 · 7 Comments
I’m working on an application that involves a lot of video content – great big files of 1 GB or more – and we found that uploading those huge files through a multipart form sucked. Duh. I started looking around at various solutions, such as chunked uploaders, and then a thought occurred to me: uploading […]
Tags: Uncategorized
When is ugly code okay?
January 24th, 2013 · 5 Comments
Yesterday I retweeted @donnfelker, who said Ugly code that ships and solves a problem is a 100 times better than beautiful code that doesn’t ship One of my friends later told me that if he didn’t already know me well he would have added my name to his list of people to never hire. Although […]
Tags: Uncategorized
Two Helper Methods I Use Too Much
January 23rd, 2013 · 3 Comments
Carets and Icons There’s nothing particularly brilliant about these, and they are probably only moderately useful. Mostly I’m putting them out there so that you can (preferably nicely) tell me how stupid I am if there is a better way. Sometimes I will add options to control whether the caret goes after the string or […]
Tags: Uncategorized
Taking the Suck Out of Active Admin Performance
December 20th, 2012 · 3 Comments
Problem #1: A nagging memory problem TroopTrack memory gets out of control every couple of days. It bumps up to 95% of available memory and stays there, triggering notifications from New Relic and slowing down traffic as TroopTrack uses swap. When this happens I will kick the web server over and life goes back to […]
Tags: Uncategorized
Creating a Calendar with Twitter Bootstrap WITHOUT TABLES
December 10th, 2012 · 6 Comments
I recently upgraded TroopTrack from Twitter Bootstrap 1 to 2, redesigning a few key aspects of the site to make it more usable. Overall, I was very pleased with the results except for one area – the calendar. I was using a calendar gem that provided a view helper that generates a table based calendar. […]
Tags: Uncategorized