Skip to content

Commit

Permalink
Add documentation for :format => true
Browse files Browse the repository at this point in the history
  • Loading branch information
sferik committed Jul 25, 2011
1 parent c41ecd7 commit 78d151d
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions railties/guides/source/routing.textile
Expand Up @@ -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:
Expand Down

0 comments on commit 78d151d

Please sign in to comment.