Skip to content

Commit

Permalink
Support new Rails 2.1.1 method of setting relative_url_root as well a…
Browse files Browse the repository at this point in the history
…s older Rails via a respond_to? check
  • Loading branch information
Chris Cherry authored and ctcherry committed Oct 17, 2008
1 parent 0455b8b commit b6b0d84
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion lib/rack/adapter/rails.rb
Expand Up @@ -31,7 +31,13 @@ def load_application
require "#{@root}/config/environment"
require 'dispatcher'

ActionController::Base.relative_url_root = @prefix if @prefix
if @prefix
if ActionController::Base.respond_to?('relative_url_root=')
ActionController::Base.relative_url_root = @prefix # Rails 2.1.1
else
ActionController::AbstractRequest.relative_url_root = @prefix
end
end
end

# TODO refactor this in File#can_serve?(path) ??
Expand Down

0 comments on commit b6b0d84

Please sign in to comment.