aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack
diff options
context:
space:
mode:
authorVijay Dev <vijaydev.cse@gmail.com>2012-08-16 00:07:17 +0530
committerVijay Dev <vijaydev.cse@gmail.com>2012-08-16 00:07:17 +0530
commit176f0888d85da38e3ae95f74b419d22e347d7a81 (patch)
tree0a46e2a790cf34785b7e8048e21fb598010e23e8 /actionpack
parentebb4a3d5becd535074502a4bf1b61a5b18e30917 (diff)
parent62499bcb9d8aa65636f5cd3ace2a818ffd4e2f8a (diff)
downloadrails-176f0888d85da38e3ae95f74b419d22e347d7a81.tar.gz
rails-176f0888d85da38e3ae95f74b419d22e347d7a81.tar.bz2
rails-176f0888d85da38e3ae95f74b419d22e347d7a81.zip
Merge branch 'master' of github.com:lifo/docrails
Diffstat (limited to 'actionpack')
-rw-r--r--actionpack/lib/action_controller/metal/data_streaming.rb4
-rw-r--r--actionpack/lib/action_view/helpers/url_helper.rb14
2 files changed, 15 insertions, 3 deletions
diff --git a/actionpack/lib/action_controller/metal/data_streaming.rb b/actionpack/lib/action_controller/metal/data_streaming.rb
index 379ff97048..5422cb93c4 100644
--- a/actionpack/lib/action_controller/metal/data_streaming.rb
+++ b/actionpack/lib/action_controller/metal/data_streaming.rb
@@ -76,8 +76,8 @@ module ActionController #:nodoc:
end
# Avoid having to pass an open file handle as the response body.
- # Rack::Sendfile will usually intercepts the response and just uses
- # the path directly, so no reason to open the file.
+ # Rack::Sendfile will usually intercept the response and uses
+ # the path directly, so there is no reason to open the file.
class FileBody #:nodoc:
attr_reader :to_path
diff --git a/actionpack/lib/action_view/helpers/url_helper.rb b/actionpack/lib/action_view/helpers/url_helper.rb
index 3d86790a8f..fe3240fdc1 100644
--- a/actionpack/lib/action_view/helpers/url_helper.rb
+++ b/actionpack/lib/action_view/helpers/url_helper.rb
@@ -60,11 +60,15 @@ module ActionView
#
# ==== Relying on named routes
#
- # Passing a record (like an Active Record) instead of a Hash as the options parameter will
+ # Passing a record (like an Active Record) instead of a hash as the options parameter will
# trigger the named route for that record. The lookup will happen on the name of the class. So passing a
# Workshop object will attempt to use the +workshop_path+ route. If you have a nested route, such as
# +admin_workshop_path+ you'll have to call that explicitly (it's impossible for +url_for+ to guess that route).
#
+ # ==== Implicit Controller Namespacing
+ #
+ # Controllers passed in using the +:controller+ option will retain their namespace unless it is an absolute one.
+ #
# ==== Examples
# <%= url_for(:action => 'index') %>
# # => /blog/
@@ -102,6 +106,14 @@ module ActionView
# <%= url_for(:back) %>
# # if request.env["HTTP_REFERER"] is not set or is blank
# # => javascript:history.back()
+ #
+ # <%= url_for(:action => 'index', :controller => 'users') %>
+ # # Assuming an "admin" namespace
+ # # => /admin/users
+ #
+ # <%= url_for(:action => 'index', :controller => '/users') %>
+ # # Specify absolute path with beginning slash
+ # # => /users
def url_for(options = nil)
case options
when String