diff options
author | Pablo Torres <tn.pablo@gmail.com> | 2012-12-02 15:11:26 -0500 |
---|---|---|
committer | Pablo Torres <tn.pablo@gmail.com> | 2012-12-02 16:53:18 -0500 |
commit | d21a46823142f62ff744e505b7d6162ffad769c4 (patch) | |
tree | ce2b1472197928db815f9dbad796d3badc190a12 /guides/source | |
parent | c41576ea45c4b092c6dd105ec6bb1b9c8830016e (diff) | |
download | rails-d21a46823142f62ff744e505b7d6162ffad769c4.tar.gz rails-d21a46823142f62ff744e505b7d6162ffad769c4.tar.bz2 rails-d21a46823142f62ff744e505b7d6162ffad769c4.zip |
Use correct conjunction and connector words [ci skip]
Diffstat (limited to 'guides/source')
-rw-r--r-- | guides/source/routing.md | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/guides/source/routing.md b/guides/source/routing.md index 329a0ad8a3..81fcee23b5 100644 --- a/guides/source/routing.md +++ b/guides/source/routing.md @@ -20,7 +20,7 @@ The Rails router recognizes URLs and dispatches them to a controller's action. I ### Connecting URLs to Code -When your Rails application receives an incoming request +When your Rails application receives an incoming request for ``` GET /patients/17 @@ -42,17 +42,19 @@ You can also generate paths and URLs. If the route above is modified to be get '/patients/:id', to: 'patients#show', as: 'patient' ``` -If your application contains this code: +and your application contains this code in the controller ```ruby @patient = Patient.find(17) ``` +and this in the corresponding view + ```erb <%= link_to 'Patient Record', patient_path(@patient) %> ``` -The router will generate the path `/patients/17`. This reduces the brittleness of your view and makes your code easier to understand. Note that the id does not need to be specified in the route helper. +then the router will generate the path `/patients/17`. This reduces the brittleness of your view and makes your code easier to understand. Note that the id does not need to be specified in the route helper. Resource Routing: the Rails Default ----------------------------------- |