From 80b656637a29ce827b10923bb357cd56cde9b15f Mon Sep 17 00:00:00 2001 From: David Heinemeier Hansson Date: Mon, 24 Jan 2005 13:50:58 +0000 Subject: Added :application_prefix to url_for and friends that makes it easier to setup Rails in non-vhost environments #516 [Jamis Buck] git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@494 5ecf4fe2-1ee6-0310-87b1-e25e094e27de --- actionpack/lib/action_controller/url_rewriter.rb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'actionpack/lib') diff --git a/actionpack/lib/action_controller/url_rewriter.rb b/actionpack/lib/action_controller/url_rewriter.rb index fa003119ec..dadae7c34b 100644 --- a/actionpack/lib/action_controller/url_rewriter.rb +++ b/actionpack/lib/action_controller/url_rewriter.rb @@ -1,7 +1,7 @@ module ActionController # Rewrites urls for Base.redirect_to and Base.url_for in the controller. class UrlRewriter #:nodoc: - VALID_OPTIONS = [:action, :action_prefix, :action_suffix, :module, :controller, :controller_prefix, :anchor, :params, :path_params, :id, :only_path, :overwrite_params, :host, :protocol ] + VALID_OPTIONS = [:action, :action_prefix, :action_suffix, :application_prefix, :module, :controller, :controller_prefix, :anchor, :params, :path_params, :id, :only_path, :overwrite_params, :host, :protocol ] def initialize(request, controller, action) @request, @controller, @action = request, controller, action @@ -41,6 +41,7 @@ module ActionController rewritten_url << (options[:protocol] || @request.protocol) unless options[:only_path] rewritten_url << (options[:host] || @request.host_with_port) unless options[:only_path] + rewritten_url << options[:application_prefix] if options[:application_prefix] rewritten_url << path rewritten_url << build_query_string(new_parameters(options)) if options[:params] || options[:overwrite_params] rewritten_url << "##{options[:anchor]}" if options[:anchor] -- cgit v1.2.3