aboutsummaryrefslogtreecommitdiffstats
path: root/railties/guides/source
diff options
context:
space:
mode:
authorErik Michaels-Ober <sferik@gmail.com>2011-07-25 14:13:26 -0700
committerXavier Noria <fxn@hashref.com>2011-08-13 16:22:15 -0700
commit6d4f91621871a23576ec6f343f08fd68dda95e0c (patch)
tree321003eb780a7df629d28bb164de9d10be6592de /railties/guides/source
parent710c5eaf2f7766885d7c8f448de8b3b3ff8929f6 (diff)
downloadrails-6d4f91621871a23576ec6f343f08fd68dda95e0c.tar.gz
rails-6d4f91621871a23576ec6f343f08fd68dda95e0c.tar.bz2
rails-6d4f91621871a23576ec6f343f08fd68dda95e0c.zip
Add documentation for :format => true
Diffstat (limited to 'railties/guides/source')
-rw-r--r--railties/guides/source/routing.textile6
1 files changed, 6 insertions, 0 deletions
diff --git a/railties/guides/source/routing.textile b/railties/guides/source/routing.textile
index 68fb22f5d8..99dd9a1cd2 100644
--- a/railties/guides/source/routing.textile
+++ b/railties/guides/source/routing.textile
@@ -569,6 +569,12 @@ NOTE: By requesting +"/foo/bar.json"+, your +params[:pages]+ will be equals to +
match '*pages' => 'pages#show', :format => false
</ruby>
+NOTE: If you want to make the format segment mandatory, so it cannot be omitted, you can supply +:format => true+ like this:
+
+<ruby>
+match '*pages' => 'pages#show', :format => true
+</ruby>
+
h4. Redirection
You can redirect any path to another path using the +redirect+ helper in your router: