Entries Tagged as 'rails'

Monday, September 10th, 2007

Running rails with mongrel for a specific sub directory

I've started using mongrel for running rails apps with apache2 and mod_proxy , it works like a charm and allows you to run multiple rails apps and mongrel instances on one server.
Your proxy setup looks like this in your httpd.conf or vhost.conf

<VirtualHost *:80>
    ServerName myapp.com
    ServerAlias www.myapp.com
    ProxyPass /myapp http://www.myapp.com:8000/
    ProxyPassReverse [...]

Monday, October 16th, 2006

Derived Columns in ActiveRecord

Sometimes it's useful to have a field in your ActiveRecord implentation that isn't actually selected in your query or present in your table. One way to acheive this is by simply adding a new accessor to your Model class.
Let's say we have a table named Customers that has a firstname and lastname column but we [...]