diff options
author | José Valim <jose.valim@gmail.com> | 2011-07-25 15:51:43 -0700 |
---|---|---|
committer | José Valim <jose.valim@gmail.com> | 2011-07-25 15:51:43 -0700 |
commit | 647eeb1881fba7863d7281515f9863f47e552ed5 (patch) | |
tree | d63662e83b3657d78df8aeabe9f09ff522e716e9 /railties | |
parent | cb85d70d61705381a57cb99d8dcd4d7083f0a143 (diff) | |
parent | c17254319b7fadb789cde24d1e72a233a33e4ac7 (diff) | |
download | rails-647eeb1881fba7863d7281515f9863f47e552ed5.tar.gz rails-647eeb1881fba7863d7281515f9863f47e552ed5.tar.bz2 rails-647eeb1881fba7863d7281515f9863f47e552ed5.zip |
Merge pull request #2262 from sferik/format_true
Allow a route to have :format => true
Diffstat (limited to 'railties')
-rw-r--r-- | railties/guides/source/routing.textile | 6 |
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: |