My Profile Photo

rubycoloredglasses


I'm Jason, a web applications developer in the San Francisco Bay area.


  1. Redirect_to not working

    I was just working on a Ruby on Rails controller method that receives information from the previous form via HTTP POST. I coded it so that if certain form variables weren’t present it would set a flash message and redirect to the form page. I tried and tried and still the redirect wasn’t working. I reset my web server, and even restarted my computer, but stil this didn’t resolve the issue. …


  2. Advanced Use of Will_Paginate

    I’m building an index of contacts, displayed with paginated links provided by will_paginate. …


  3. Getting File object for Paperclip Attachment via S3

    I’m working on a project where we are using the Paperclip plugin for Ruby on Rails for file handling and associations with other models. …


  4. Issues with MacPorts After Upgrading to OS X Lion

    I realized this morning that I was having dependency issues with ImageMagick on my Mac, which I installed using MacPorts. I had recently upgraded to Mac OS X Lion, so it made sense that I needed to update the software to resolve the issues, much like I had when I upgraded to Snow Leopard. …


  5. Error: 'unintitialized constant MySQL' with Rails 3 on Snow Leopard Mac

    I just installed Rails 3 on my iMac, which is running Snow Leopard. I’m trying to build a web hosting website/billing system/management system. I configured the app to use MySQL in /config/database.yml like so: …


  6. Installing PHPdoc for Ubuntu for use with Command Line

    I wanted to install PhpDocumentor for use on my server so that I could generate documentation from the command line. I found this article, which instructed me to somehow change the PEAR setting for data_dir. I installed PhpDocumentor in my web root and it just didn’t work and gave me a bunch of errors in the browser. …


  7. Ruby on Rails session - Access from PHP

    If you need to access a Ruby on Rails session from a PHP application running under the same domain, you can do this by splitting the string in the cookie by the ‘–’. Thanks to Frederick Cheung for pointing this out. …


  8. Obtaining Request Domain Name for Ruby on Rails

    I’m using Rails 2.3.8. To obtain the domain name for the website being requested (i.e. mysite.com, mysite.net), just reference ‘request.host’. …


  9. Changing Column Order via ActiveRecord Migration

    Is it possible to change the order of the columns in your MySQL (or other database) table using a migration? Lets see. …


  10. Rails Performance Statistics

    Again, as I search for things, I stumble onto new tools. I just found out about a tool for monitoring the performance of Java and Ruby applications called New Relic. …