diff options
author | Vijay Dev <vijaydev.cse@gmail.com> | 2011-04-04 02:43:12 +0530 |
---|---|---|
committer | Vijay Dev <vijaydev.cse@gmail.com> | 2011-04-04 02:43:12 +0530 |
commit | 4ac719686c0075b6ad6896becfe0f058efdb97ff (patch) | |
tree | 6255a8fc483436dc0fc89c0a2bc2755a51ecc329 /railties/guides/source/routing.textile | |
parent | 4c76f6894889e8e3f5cc3722d928954c79422542 (diff) | |
parent | 3e24e9ebc22f96f9124d3a5d1c83b93c1bea937d (diff) | |
download | rails-4ac719686c0075b6ad6896becfe0f058efdb97ff.tar.gz rails-4ac719686c0075b6ad6896becfe0f058efdb97ff.tar.bz2 rails-4ac719686c0075b6ad6896becfe0f058efdb97ff.zip |
Merge branch 'master' of github.com:lifo/docrails
Diffstat (limited to 'railties/guides/source/routing.textile')
-rw-r--r-- | railties/guides/source/routing.textile | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/railties/guides/source/routing.textile b/railties/guides/source/routing.textile index c447fd911a..58b75b9a1d 100644 --- a/railties/guides/source/routing.textile +++ b/railties/guides/source/routing.textile @@ -557,6 +557,18 @@ match '*a/foo/*b' => 'test#index' would match +zoo/woo/foo/bar/baz+ with +params[:a]+ equals +"zoo/woo"+, and +params[:b]+ equals +"bar/baz"+. +NOTE: Starting from Rails 3.1, wildcard route will always matching the optional format segment by default. For example if you have this route: + +<ruby> +map '*pages' => 'pages#show' +</ruby> + +NOTE: By requesting +"/foo/bar.json"+, your +params[:pages]+ will be equals to +"foo/bar"+ with the request format of JSON. If you want the old 3.0.x behavior back, you could supply +:format => false+ like this: + +<ruby> +map '*pages' => 'pages#show', :format => false +</ruby> + h4. Redirection You can redirect any path to another path using the +redirect+ helper in your router: |