aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/lib/action_dispatch
diff options
context:
space:
mode:
authorVijay Dev <vijaydev.cse@gmail.com>2012-04-18 00:10:06 +0530
committerVijay Dev <vijaydev.cse@gmail.com>2012-04-18 00:10:06 +0530
commit5b336ff44364ac4adcf137838e71a8f0bb4f35a0 (patch)
treec15002d3b3a2a5c2a2f8c17c309f170620025408 /actionpack/lib/action_dispatch
parent1d26fcb9f896a3dc98d90ad734aa5da7ac2bbcda (diff)
parentb7e3c8e1f387e4c0843371971317ca7972d8aeb5 (diff)
downloadrails-5b336ff44364ac4adcf137838e71a8f0bb4f35a0.tar.gz
rails-5b336ff44364ac4adcf137838e71a8f0bb4f35a0.tar.bz2
rails-5b336ff44364ac4adcf137838e71a8f0bb4f35a0.zip
Merge branch 'master' of github.com:lifo/docrails
Diffstat (limited to 'actionpack/lib/action_dispatch')
-rw-r--r--actionpack/lib/action_dispatch/http/response.rb2
-rw-r--r--actionpack/lib/action_dispatch/middleware/flash.rb2
-rw-r--r--actionpack/lib/action_dispatch/routing/redirection.rb9
3 files changed, 8 insertions, 5 deletions
diff --git a/actionpack/lib/action_dispatch/http/response.rb b/actionpack/lib/action_dispatch/http/response.rb
index 078229efd2..cc46f9983c 100644
--- a/actionpack/lib/action_dispatch/http/response.rb
+++ b/actionpack/lib/action_dispatch/http/response.rb
@@ -29,7 +29,7 @@ module ActionDispatch # :nodoc:
# class DemoControllerTest < ActionDispatch::IntegrationTest
# def test_print_root_path_to_console
# get('/')
- # puts @response.body
+ # puts response.body
# end
# end
class Response
diff --git a/actionpack/lib/action_dispatch/middleware/flash.rb b/actionpack/lib/action_dispatch/middleware/flash.rb
index cff0877030..c92c91df65 100644
--- a/actionpack/lib/action_dispatch/middleware/flash.rb
+++ b/actionpack/lib/action_dispatch/middleware/flash.rb
@@ -17,7 +17,7 @@ module ActionDispatch
# def create
# # save post
# flash[:notice] = "Post successfully created"
- # redirect_to posts_path(@post)
+ # redirect_to @post
# end
#
# def show
diff --git a/actionpack/lib/action_dispatch/routing/redirection.rb b/actionpack/lib/action_dispatch/routing/redirection.rb
index 617b24b46a..f281738e6f 100644
--- a/actionpack/lib/action_dispatch/routing/redirection.rb
+++ b/actionpack/lib/action_dispatch/routing/redirection.rb
@@ -67,10 +67,13 @@ module ActionDispatch
# params, depending of how many arguments your block accepts. A string is required as a
# return value.
#
- # match 'jokes/:number', :to => redirect do |params, request|
- # path = (params[:number].to_i.even? ? "/wheres-the-beef" : "/i-love-lamp")
+ # match 'jokes/:number', :to => redirect { |params, request|
+ # path = (params[:number].to_i.even? ? "wheres-the-beef" : "i-love-lamp")
# "http://#{request.host_with_port}/#{path}"
- # end
+ # }
+ #
+ # Note that the `do end` syntax for the redirect block wouldn't work, as Ruby would pass
+ # the block to `match` instead of `redirect`. Use `{ ... }` instead.
#
# The options version of redirect allows you to supply only the parts of the url which need
# to change, it also supports interpolation of the path similar to the first example.