Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update services.adoc with show method line numbers #29

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/main/docs/guide/services.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -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="22..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.
Expand All @@ -77,4 +77,4 @@ include::{sourceDir}/grails-app/views/vehicle/show.gsp[indent=0,lines="17..20"]
----
<1> `<g:formatNumber>` 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
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