diff options
author | David Heinemeier Hansson <david@loudthinking.com> | 2005-03-26 13:38:21 +0000 |
---|---|---|
committer | David Heinemeier Hansson <david@loudthinking.com> | 2005-03-26 13:38:21 +0000 |
commit | 7a6a923f983a2d642a4efd4e962b4385987e167a (patch) | |
tree | 33351ac4dd0f5449bbd0f9c349bb0af20f201a59 /actionpack/lib/action_controller/url_rewriter.rb | |
parent | cef57e0cc244062663ad5fc5652072a12f06aaf2 (diff) | |
download | rails-7a6a923f983a2d642a4efd4e962b4385987e167a.tar.gz rails-7a6a923f983a2d642a4efd4e962b4385987e167a.tar.bz2 rails-7a6a923f983a2d642a4efd4e962b4385987e167a.zip |
Added trailing_slash option to url_for, so you can generate urls ending in a slash. Note that is currently not recommended unless you need it for special reasons since it breaks caching #937 [stian@grytoyr.net]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@1001 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
Diffstat (limited to 'actionpack/lib/action_controller/url_rewriter.rb')
-rw-r--r-- | actionpack/lib/action_controller/url_rewriter.rb | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/actionpack/lib/action_controller/url_rewriter.rb b/actionpack/lib/action_controller/url_rewriter.rb index 89245ceb37..8328de7e4f 100644 --- a/actionpack/lib/action_controller/url_rewriter.rb +++ b/actionpack/lib/action_controller/url_rewriter.rb @@ -2,7 +2,7 @@ module ActionController # Rewrites URLs for Base.redirect_to and Base.url_for in the controller. class UrlRewriter #:nodoc: - RESERVED_OPTIONS = [:anchor, :params, :only_path, :host, :protocol] + RESERVED_OPTIONS = [:anchor, :params, :only_path, :host, :protocol, :trailing_slash] def initialize(request, parameters) @request, @parameters = request, parameters end @@ -26,6 +26,7 @@ module ActionController rewritten_url << @request.relative_url_root.to_s rewritten_url << path + rewritten_url << '/' if options[:trailing_slash] rewritten_url << "##{options[:anchor]}" if options[:anchor] return rewritten_url |