Category Archives: Ruby on Rails

Testing subdomain sites the easy way

You have two options to test sites that use multiple subdomains:

  1. Add each and every subdomain to your host file
  2. site1.mywebapp.local site2.mywebapp.local

  3. Setup a DNS server (Dnsmasq or Bind)

Both these approaches have their disadvantages. Updating your hosts file can become tedious, especially if your site supports dynamic subdomain creation. And setting up a DNS server takes some effort.

Tim Pope found a simple workaround for this problem. As he mentions here:

“I grabbed and made it a localhost wildcard, pointing * at”

So that means you can now use URLs like or without having to add them to your hosts file.

One issue remains: say my development box is at in my home network and my Droid is at, how would I be able to access the sites on my Droid? One way is to update the hosts file on the Droid, but you need root access for that.

So I grabbed and made it point to my dev machine’s local ip address: * points to Now I can access my development sites from all the devices on my network without having to update the hosts file on each and every one of them.


Using ActiveMerchant with Payflow Pro

Connection parameter’s for Payflow gateway:

  1. VENDOR => The merchant login ID that you created when you registered
  2. USER => User id of the user responsible for processing transactions (Usually same as the VENDOR unless you created additional users and assigned appropriate roles).
  3. PARTNER => From whom did you purchase your account? If from PayPal, then use the “PayPal”
  4. PWD => The password for the user mentioned in step (2)
gateway =
  :user => 'user-name',        #USER
  :login => 'merchant-id',     #VENDOR
  :partner => 'partner-name',  #PARTNER
  :password => 'my-password'   #PWD