From the course: Hands-On Introduction: Ruby on Rails

Unlock the full course today

Join today to access over 24,400 courses taught by industry experts.

Removing the show action

Removing the show action

- [Instructor] Since we are mimicking Instagram, we don't need a page to display the post, so I'll show you how to remove it and leave everything in order. Make sure to start the real server and to tell the CSS compiler. Let's start with the post partial. We don't need to display description, so let's remove it. Remove the "Show this post" link. Let's modify the "Edit this post" link so it doesn't look like a button. Remove its classes, rename it to edit. And to finish, remove the if that wraps it because we want to show it always. Open the show template. Copy the destroy this post button and the wrapping diff. Now, open the edit template and paste the diff before the "Back to posts" link. We need this diff because we're not using link two, but button two with the delete method. And this generates a form. So to align the button correctly, it must be inside a container. Let's change its background color to dark red with white text. Remove the "Show this post" link. You can now remove…

Contents