Easy Money – Our Latest Rails Love Child

Posted February 15, 2008 by Dan
Categories: Uncategorized

Easy Money LogoToday we released another application, this our first foray with the Facebook® platform.  The application called “Easy Money” allows players to bid and win gift cards in daily drawings. The application uses Rails 2.0.2, MySQL, backgroundrb, memcached and the facebooker plugin.

We will have a series of technical posts coming soon, talking about the challenges and tweaks me made to get everything working in the RESTful style we love. If you want to see the results you can checkout the Easy Money application here.

Facebook® is a registered trademark of Facebook Inc.

Fun with Rails Constantize

Posted December 1, 2007 by Dan
Categories: DRY, rails

Visualization DiagramHave you ever found yourself working on a Rails project where you need certain behavior in a model based on type but STI[1] is not the right fit or you are already using STI and can not subtype again? I was working on a problem where a model utilized STI to create two types: Icon and Color. Within each type I had different data. Some of the data represented defaults for Icons or defaults for Colors and the others were specific. I’ve put together a little diagram on the right to illustrate this[2].

The way we had modeled the data made it very easy to pick out the specific icon or color theme (using an ActiveRecord finder for that type). However, based on the data instance returned by find I wanted to execute a series of methods to populate other models with data relevant to the Icon or Color instance. Read the rest of this post »

Sexy Time Zones in Ruby on Rails with Timezone_Fu

Posted November 23, 2007 by Dan
Categories: rails

Tags: , , ,

As easy as has_timezone :fields => [ :start_datetime, :end_datetime].

Working with Timezones in Rails even after you have installed the TZInfo plugin is still a pain in the you know what. (You are using TZInfo, right?) World TimezonesI never liked having to jump through hoops converting from UTC to localtime when displaying times to Users. I suppose I could have used Javascript to do the conversion but I prefer to deal with the conversion on the back end.

Adding support for time zones to our apps wasn’t very fun. While adding timezones to another model model for the third or forth time I decided there had to be a better way. I pointed my browser to the agile web development plug in site and did a quick search. I found a couple plug-ins that helped with timezones or helped with date time pickers; but nothing that did quite what I wanted. Read the rest of this post »

Zero to Riding the Rails in Four Months

Posted October 14, 2007 by Dan
Categories: rails, Technology

Tags: , ,

rails-podcast.pngWhew! four months of nose-to-the-keyboard development work, and we launched our new product! Because it was the first time we designed, developed, and deployed a complete web application with our new team, we wanted to chronicle our experiences over the whole process – particularly with Ruby on Rails. We thought doing so would help us improve on our experiences in the future. And we hope it can help you too…

In the beginning there was Java and it was good, but something was missing. Java as a partner was not particularly pretty, it was not very fun to wake up to in the morning, but it got the job done. In late May Daniel sent an IM to Matt, He was having problems with eclipse and svn and went off on a tangent. The IM went something like this:

Daniel: “I see why the RoR people are in love. Not that SVN has anything to do with RoR”
Matt: “RoR?”
Daniel: “Ruby on Rails, I was playing with it yesterday”
Matt: “I see, is it good for backend? frontend? both?”
Daniel: “If you are ok with going with the defaults it lets you focus only on developing features, so you don’t have to worry about backend or frontend. Some of the deployment tools are pretty neat too. Ok, back to topic…”

Daniel had just watched the Rails Screencasts and was in love. The concerns we were having with Java and Google Web Toolkit seemed like they would probably go away with Rails. It took a long time to develop new features the way we had been doing things. After debating the topic for a while we had a founder’s meeting in the car while driving to Target, and decided: we would devote two weeks to try our hand at porting (rewriting) YouBook from Java to Ruby on Rails. We quickly purchased the PDF+Hard Copies of “Programming Ruby” and “Agile Web Development with Rails” from Pragmatic Programmers, and the adventure began.

Read the rest of this post »

Extract Colors from CSS Code

Posted October 1, 2007 by Matt
Categories: CSS, User Interface

css-color-extractor_1191268352898.pngGetting the colors right in CSS can be a bit of a pain without the right tools. An interesting tool I came across extracted the colors from a published site.

But I needed something (easy) to use in development. So I wrote a little tool I’d like to share with you!

Read the rest of this post »

Part Two: How to Create an Image Selection & Upload Plugin for tinyMCE with Ruby on Rails

Posted August 28, 2007 by Dan
Categories: User Interface

Update: A sample project is now available

In the first part of our how-to we created a tinyMCE plugin with a dynamic image selector panel based on the advimage plugin. Now we will add functionality to upload images or select an existing image.

Our plugin needed to satisfy the following requirements:

  • Use the existing inline popup (IFRAME) adding a form for uploading an image. We did not want the user to be directed to another page or create a pop up window.
  • In javascript determine which controller to call in the form because we can not pass a variable from the parent to the image selection IFRAME.
  • The image selection IFRAME should not reload when the form is submitted. Reloading the IFRAME would trigger another fetch of uploaded images and that should be avoided.
  • After an image is successfully uploaded the source and alternative text fields should be set as if the user had clicked on an existing image and the IFRAME should then disappear using the plugins existing functionality.

picture-1.png Read the rest of this post »

How-To Make a Rails Partial With Optional Locals (Parameters)

Posted August 25, 2007 by Matt
Categories: DRY, partials

Sorry, this article has moved!