I recently wrote a blog post describing how to create your own RubyGem. The sample gem produced, aptly named dogeify, converts English sentences into “Doge” based upon the recently popular meme. For April Fools’ Day, we thought it would be fun to implement this gem to convert our entire site into doge. Here’s how we did it.
Implementing forms that are associated with models — specifically ActiveRecord objects — is pretty common when developing with Ruby on Rails. In fact, the built-in FormHelper assumes that you’re working with some kind of persisted object. But what happens when you want to create a form for something that is not persisted by an ActiveRecord model?
I’ve been spending my free hours lately working on a realtime multiplayer game. In building the game, I decided to build the front-end using Ruby on Rails with the actual game implemented using Node.js, specifically using Socket.IO. One of the first major challenges I encountered with this approach is the need to share session data[…]
Several months ago, I had the opportunity to improve part of a testing suite for an application I worked on. Specifically, I was improving some unit testing pertaining to the creation of DelayedJob entries when emailing users. The code being tested related to users being emailed upon registration on the site. def User < ActiveRecord::Base[…]
Just today, I ran into a situation where I wanted to modify the output generated by Formtastic while building an input element. In this particular scenario, the input field was a file input in which the user is expected to upload an image (PNG, JPG, or GIF). The customization I wanted was the ability to[…]
This past week, I released my first ever Ruby gem: multiple_table_inheritance. Multiple Table Inheritance is an ActiveRecord plugin designed for Rails 3.0+ designed to make table-level inheritance easier than ever. Imagine you have an application that needs to maintain a list of employees. You’ll probably start out with a few columns including first name, last[…]
With users uploading personal photos, especially ones coming their phones that capture landscape photos in portrait mode and vice versa, one of the things I wanted to integrate into Black Book Singles is the ability to rotate photos. Since I’m using the Paperclip gem, this should be relatively easy to achieve through a custom attachment[…]
While I continue to work on my free online dating service (as well as the accompanying Android dating app), I delve into new territories of Ruby, Rails, and Android programming that I previously have not had to deal with. As such, I’m constantly searching for info to teach myself where to start, where to turn,[…]
In order to better analyze my registrations, I wanted to be able to associate them with their respective traffic sources and any search terms used to find my dating service. While searching for an existing gem that takes care of this, the closest thing I could find was a plugin named search_sniffer. Unfortunately, this plugin[…]
Tonight, in a little under an hour, I was able to implement spam prevention for my user registration flow thanks to the simple API provided by Stop-Registration-Spam.org. In Rails 3, creating new validators is relatively painless. Create a new validator class in a folder defined by you. For my project, I decided to place all[…]