Navigating the User Interface Client-Side

With the router and our routes configured, we need to implement the navigation. We want to be able to do two things with what we’ve set up. First, we need to add a button to each search result that, when clicked, navigates from /customers/ng to /customers/ng/«customer id». Second, we need to extract that customer ID from the URL so we know which customer’s details we want to view.

Add Navigation to the Detail View

In Respond to Click Events, you saw how to respond to click events. What we want to do here is exactly the same thing. First, let’s add a button to each search result that the user will use to view a single customer’s details. We’ll add it to the bottom right of our search result using Bootstrap’s ...

Get Rails, Angular, Postgres, and Bootstrap, 2nd Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.