aboutsummaryrefslogtreecommitdiffstats
path: root/guides
diff options
context:
space:
mode:
authorAndrew White <andyw@pixeltrix.co.uk>2015-08-03 11:45:44 +0100
committerAndrew White <andyw@pixeltrix.co.uk>2015-08-03 11:50:12 +0100
commitaa79574d0940ebc717ae1b24fae9759d9ddf5c63 (patch)
treee5f6599d3e69497a61bf0ad32856b74425b16c62 /guides
parent3a5c3f5304fc1c6c72dca689f544859636625b1e (diff)
downloadrails-aa79574d0940ebc717ae1b24fae9759d9ddf5c63.tar.gz
rails-aa79574d0940ebc717ae1b24fae9759d9ddf5c63.tar.bz2
rails-aa79574d0940ebc717ae1b24fae9759d9ddf5c63.zip
Add note to routing guide about overriding defaults [ci skip]
Fixes #21085.
Diffstat (limited to 'guides')
-rw-r--r--guides/source/routing.md2
1 files changed, 2 insertions, 0 deletions
diff --git a/guides/source/routing.md b/guides/source/routing.md
index 02763eabcd..cf828462ce 100644
--- a/guides/source/routing.md
+++ b/guides/source/routing.md
@@ -615,6 +615,8 @@ get 'photos/:id', to: 'photos#show', defaults: { format: 'jpg' }
Rails would match `photos/12` to the `show` action of `PhotosController`, and set `params[:format]` to `"jpg"`.
+NOTE: You cannot override defaults via query parameters - this is for security reasons. The only defaults that can be overridden are dynamic segments via substitution in the URL path.
+
### Naming Routes
You can specify a name for any route using the `:as` option: