diff options
author | Jon Leighton <j@jonathanleighton.com> | 2010-11-17 11:32:31 +0000 |
---|---|---|
committer | Jon Leighton <j@jonathanleighton.com> | 2010-11-17 11:32:31 +0000 |
commit | 1bc90044b655572a4b8aa3b323905e26d37e0f2b (patch) | |
tree | 84a2d67b24e149b703308c892d1ec37a1019103b /railties/guides/source/routing.textile | |
parent | e05162cffad7ae86615c21c6b54ab161d0261c39 (diff) | |
parent | 401c1835afb5af1a6f429061ac8484227c34909d (diff) | |
download | rails-1bc90044b655572a4b8aa3b323905e26d37e0f2b.tar.gz rails-1bc90044b655572a4b8aa3b323905e26d37e0f2b.tar.bz2 rails-1bc90044b655572a4b8aa3b323905e26d37e0f2b.zip |
Merge branch 'master' into nested_has_many_through
Conflicts:
activerecord/lib/active_record/associations/has_many_through_association.rb
activerecord/test/cases/associations/has_many_through_associations_test.rb
Diffstat (limited to 'railties/guides/source/routing.textile')
-rw-r--r-- | railties/guides/source/routing.textile | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/railties/guides/source/routing.textile b/railties/guides/source/routing.textile index f48ae9c7f7..cc0c3316c8 100644 --- a/railties/guides/source/routing.textile +++ b/railties/guides/source/routing.textile @@ -436,6 +436,26 @@ match 'exit' => 'sessions#destroy', :as => :logout This will create +logout_path+ and +logout_url+ as named helpers in your application. Calling +logout_path+ will return +/exit+ +h4. HTTP Verb Constraints + +You can use the +:via+ option to constrain the request to one or more HTTP methods: + +<ruby> +match 'photos/show' => 'photos#show', :via => :get +</ruby> + +There is a shorthand version of this as well: + +<ruby> +get 'photos/show' +</ruby> + +You can also permit more than one verb to a single route: + +<ruby> +match 'photos/show' => 'photos#show', :via => [:get, :post] +</ruby> + h4. Segment Constraints You can use the +:constraints+ option to enforce a format for a dynamic segment: |