diff --git a/src/main/docs/guide/services.adoc b/src/main/docs/guide/services.adoc index 1499673..6447072 100644 --- a/src/main/docs/guide/services.adoc +++ b/src/main/docs/guide/services.adoc @@ -53,7 +53,7 @@ Edit `grails-app/controllers/org/grails/guides/VehicleController.groovy` (the sc [source,groovy] .grails-app/controllers/org/grails/guides/VehicleController.groovy ---- -include::{sourceDir}/grails-app/controllers/org/grails/guides/scaffolding/VehicleController.groovy[indent=0,lines="6..11"] +include::{sourceDir}/grails-app/controllers/org/grails/guides/scaffolding/VehicleController.groovy[indent=0,lines="11..15"] ---- <1> By simply defining a property in our controller with the same name as our service class, Grails will inject a reference to the service for us. @@ -63,7 +63,7 @@ Now (still editing `VehicleController.groovy`), modify the `show` action as seen [source,groovy] .grails-app/controllers/org/grails/guides/VehicleController.groovy ---- -include::{sourceDir}/grails-app/controllers/org/grails/guides/VehicleController.groovy[indent=0,lines="18..20"] +include::{sourceDir}/grails-app/controllers/org/grails/guides/VehicleController.groovy[indent=0,lines="20..24"] ---- We've added new property to the `model`, called `estimatedValue`. The value of this property is the result of calling our service method, `getEstimate`, to which we pass the `vehicle` property we are about to render. @@ -77,4 +77,4 @@ include::{sourceDir}/grails-app/views/vehicle/show.gsp[indent=0,lines="17..20"] ---- <1> `` is another GSP tag which provides many useful options for rendering numbers, including currency and decimal precision. See the http://docs.grails.org/latest/ref/Tags/formatNumber.html[Grails documentation] for more. -Restart the application and browse to the show page for a `Vehicle`, such as `http://localhost:8080/vehicle/show/1`. You should see the "Estimated Value" on the page \ No newline at end of file +Restart the application and browse to the show page for a `Vehicle`, such as `http://localhost:8080/vehicle/show/1`. You should see the "Estimated Value" on the page