From 1230253153edcccc1316f1ab9bc16684ba02b0ae Mon Sep 17 00:00:00 2001 From: simonjamain Date: Fri, 27 Apr 2018 20:09:54 +0200 Subject: =?UTF-8?q?Adding=20precision=20about=20which=20letter=20case=20to?= =?UTF-8?q?=20use=20for=20controller=20names=20=E2=80=A6=20(#32740)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * 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 --- guides/source/routing.md | 2 ++ 1 file changed, 2 insertions(+) (limited to 'guides/source') 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: -- cgit v1.2.3