Heads up! To view this whole video, sign in with your Courses account or enroll in your free 7-day trial. Sign In Enroll
Well done!
You have completed Intro to Java Web Development with Spark!
You have completed Intro to Java Web Development with Spark!
Preview
Most web applications follow the same design pattern, there is a list of items and a more detailed view of each item. Let’s ensure you can access a specific item from your list by using what is known as a slug.
Directions
- Add a new page that responds to
/ideas/:slug/. The controller should get the model by the slug passed in the url and pass it as the model for the template created in step 2.
- Add a new template for the idea detail page. Make it inherit from our base template.
- The content of the new idea detail page should list everyone who voted. You might need a new keyword.
- Add a form that allows voting for this specific idea. Route it to the existing vote route.
Related Discussions
Have questions about this video? Start a discussion with the community and Treehouse staff.
Sign upRelated Discussions
Have questions about this video? Start a discussion with the community and Treehouse staff.
Sign up
Most notably you're going to show a list
of things just like we did with ideas, and
0:00
then you're going to show each of those
items on a separate, more detailed page.
0:02
Now, what this means is you'll need a way
to uniquely identify each of those items.
0:07
Now, you've probably seen
some ugly URLs in your time,
0:11
cruising around the interwebs.
0:14
While we don't have one,
most web apps are using a database, and
0:16
they usually provide a way to
uniquely identify an item,
0:20
by what is known as an ID,
which is short for identifier.
0:23
Well, those are usually numeric, and
some sites just pop them in their URL.
0:27
You need to sign up for Treehouse in order to download course files.
Sign upYou need to sign up for Treehouse in order to set up Workspace
Sign up