Archive for September, 2007

text_field and currency values

September 16th, 2007

I’ve asked around about this issue and nobody has been able to give me a straightforward solution. It is for that reason that I’m not afraid to share my hack. If there’s a better way to do this in Rails, let me know.
The problem: you’re using some sort Numeric field for storing monetary [...]

Quick Rails Logging Tip

September 14th, 2007

It’s not difficult to alter how Rails logs requests. Just look at ActionController::Base#log_processing (see code here), and you can see that’s it’s basically just printing request.inspect. So if you override that method in your ApplicationController, you can change how requests are logged. This was important for me, because I’m using gsub to [...]

I can take your money

September 13th, 2007

Or, rather, the Rails web app I’ve been working on for the past month can. After a very frustrating week of slack-ass-edness from Wachovia, we finally got stuff hooked up right for credit card donations to this new political action committee. So the big hurdle has officially been crossed - though at the [...]

Question on migrations

September 9th, 2007

OK. So you have been using migrations to iteratively modify your database and populate it with information as you flesh out your application. Awesome. Now, what happens when you change the model definitions and try to rollback and then roll forward?
This is the problem I’m encountering. For example, I’ve made changes to [...]

Basic Authentication with Apache 2.2.*, mod_proxy_balancer, and Mongrel

September 6th, 2007

Clients frequently like to keep applications under development behind some kind of basic authentication. Apache makes this easy, but mod_proxy_balancer complicates things slightly. While you normally put your AllowOverride, AuthType, etc. directives under the correct Directory definition, if you try doing this alone with a Rails app running on a mongrel cluster, you’ll [...]