Linking Pages Together

It’s a rare web application that has just one page. Let’s see how we can add another stunning example of web design to our Hello, World! application.

Normally, each page in our application will correspond to a separate view. While we’ll also use a new action method to handle the new page, we’ll use the same controller for both actions. This needn’t be the case, but we have no compelling reason to use a new controller right now.

We already defined a goodbye action for this controller, so all that remains is to update the scaffolding that was generated in the app/views/say directory. This time the file we’ll be updating is called goodbye.html.erb because by default templates are named after their associated actions: ...

Get Agile Web Development with Rails 7 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.