actioncontroller

Ruby on Rails Cheat Sheet Collectors Edition

This Ruby on Rails cheat sheet is a reference guide for RubyOnRailsBlog.com that will be continuosly updated and improved as new features are added to rails and new cheat sheet tips are added to the guide. It is a collection from the one of the very best guides, apis and source snippets that are concise that i’ve found. I’ve fixed errors and added highlighting to it and it is a mirror of the one found on nanorails site plus my own changes. New updates will be posted to this post under Recent Updates.

Setting the Relative Url Path in Ruby on Rails

The Problem

You're using apache with fastcgi and you can access the "you're running rails" page at the but can't get to any of my controllers at , getting 500 errors instead.

 

The Solution

In environment.rb set the following at the bottom:

 

ActionController::AbstractRequest.relativeurlroot = '/myrailsapp'

If that fails, I recommend trying it with mongrel webserver which has been known to fix whis problem for many.