Agile Tortoise
Greg Pierce’s blog
« Squidly Diddly, reprise Last minute donations! »
Set base path for Rails app
After a bit of searching, I finally figured out how to force Rails to use a particular base path when generating url via any of the various methods that pass through “url_for.” Add the following line to your environment.rb file:
ActionController::AbstractRequest.relative_url_root = "/[basepath]"
October 1st, 2007 at 3:07 pm
[...] See also http://greg.agiletortoise.com/2006/08/23/set-base-path-for-rails-app/ [...]
October 1st, 2007 at 3:12 pm
[...] On 9/26/07, Frederick Cheung <rails-mailing-list@…> wrote: > > I changed map.connect ‘:controller/:action/:id’ to > map.connect ‘foo/:controller/:action/:id’ > and restarted the server. > > See also > http://greg.agiletortoise.com/2006/08/23/set-base-path-for-rails-app/ [...]
October 2nd, 2007 at 6:10 am
[...] > > and restarted the server. > > > See also > >http://greg.agiletortoise.com/2006/08/23/set-base-path-for-rails-app/ > > Both good info, thanks! > > – > Hassan Schroeder [...]
June 8th, 2008 at 1:15 pm
Very very good, Greg. It work perfectely for my Rails app that is in a particular directory of my domain.