diff options
author | simonjamain <jamain.simon@gmail.com> | 2018-04-27 20:09:54 +0200 |
---|---|---|
committer | Eileen M. Uchitelle <eileencodes@users.noreply.github.com> | 2018-04-27 14:09:54 -0400 |
commit | 1230253153edcccc1316f1ab9bc16684ba02b0ae (patch) | |
tree | 6edfcedd69d28c51ed443bfd01ee3c7b899bc9a7 | |
parent | 19c80718afea8cf8f56ee68fcfbe325d54c02906 (diff) | |
download | rails-1230253153edcccc1316f1ab9bc16684ba02b0ae.tar.gz rails-1230253153edcccc1316f1ab9bc16684ba02b0ae.tar.bz2 rails-1230253153edcccc1316f1ab9bc16684ba02b0ae.zip |
Adding precision about which letter case to use for controller names … (#32740)
* Adding precision about which letter case to use for controller names in routing
Many people (including myself) encounter an error when having multiple words controller names and trying to put camelCase in their routes
-rw-r--r-- | guides/source/routing.md | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/guides/source/routing.md b/guides/source/routing.md index 3cf5b56340..7a83fee617 100644 --- a/guides/source/routing.md +++ b/guides/source/routing.md @@ -36,6 +36,8 @@ get '/patients/:id', to: 'patients#show' the request is dispatched to the `patients` controller's `show` action with `{ id: '17' }` in `params`. +NOTE: Rails uses snake_case for controller names here, if you have a multiple word controller like `MonsterTrucksController`, you want to use `monster_trucks#show` for example. + ### Generating Paths and URLs from Code You can also generate paths and URLs. If the route above is modified to be: |