High Leverage Rails
Introduction
Introduction to this course
Why use Ruby on Rails
Why use SQLite
Ruby on Rails + SQLite
Powering Your App with SQLite
Creating tables
Timestamps
Column types
Typeof
Ruby types
Creating table introduction
Creating table advanced
Inserting data
Updating data
Upserting data
Reading data
Virtual columns
Enums
Introduction to JSON
Indexing JSON
JSON table functions
Building a Modern Rails Application
Creating a new Rails application
Installing Solid Queue
Installing Solid Cache
Installing Solid Cable
Dockerfile
Application overview
Authentication
Base styles
Registration
Scaffolding posts
Polishing posts
Scaffolding comments
Polishing comments
Polishing models
Polishing controllers
Creating new post
Updating post
Reviewing MVP
Tagging posts
Custom tags
Friendly URLs
Full text search
Deploying & Operating Your App
Backups
Check Litestream locally
Verifying backups
Deployment options
Deploying with Hatchbox
Deployment constraints
Vertical scaling
Database access
Migrations
Locked video

Please purchase the course to watch this video.

Video thumbnail
Building a Modern Rails Application
Updating post

Full Course

$
129
$179
USD, one-time fee
This course came at the perfect time. I’ve recently gotten back into Rails after an 18-year hiatus, and this was a perfect refresher and shows just how much you can accomplish with Rails right out of the box.
Garrett Winder
Garrett Winder

Move fast and fix things

Application monitoring that helps developers get it done.

Rails hosting made simple

Deploy apps to servers that you own and control.

Summary

Learn how to redesign the post show page in Rails to enhance styling, navigation, and accessibility. This video covers refining post titles, action buttons, and comment layout while leveraging Rails helpers for a more readable and user-friendly interface. Follow along as we continue improving the UI and documenting changes for better usability.

Video Transcript

Next up, let's turn our attention to the post show page.

If we look at our browser, it's pretty rough—there’s a lot we can do to improve the styling and usability of this page. Let's jump in and refine it step by step.

Enhancing the Post Title & Navigation

The first thing I want to do is add a standard title for the post card. Using the post title as our <h1> tag seems like a great solution. Now, the post title is prominently displayed as an H1 heading.

Now let's improve the navigation on the “Back to Posts” link. It now has a left arrow icon and follows a more consistent style.

Optimizing Post Content & Formatting

Next, let’s clean up the post content layout:

  • Used simple_format helper to ensure that new lines in the text area convert properly into paragraph tags.
  • Moved edit and delete buttons for a better UX flow.
  • Used Rails conditionals to structure the layout cleanly.
  • Wrapped buttons in a div container for styling control.
  • Applied button-like styling to links for consistency.

Adding Visual Hierarchy to Buttons

We want the delete button to stand out since it's a destructive action.

Created a dangerous class that:

  • Uses red text and a red border.
  • Turns fully red on hover.

Repositioned buttons horizontally with a flex container and gap spacing.

Improving Comment Section Layout

The comments section needed better separation from the post.

Added a horizontal rule (<hr>)

  • Styled it to match the outer border thickness.
  • Used border-t-2 instead of a full border for a cleaner look.

Included metadata above the post:

  • Displays the author’s name (or “you” if it's the logged-in user).
  • Shows when the post was created, with a hoverable timestamp for exact time details.
  • Uses a Rails helper (time_ago_in_words) for human-friendly readability.
  • Links the comment count to jump directly to the comments section.

Adding Smooth Scroll for Comments

To ensure clicking the comment count link smoothly scrolls to the comments section:

  • Wrapped comments in a <div id="comments">
  • Clicking the comment count now jumps directly to this section.

Refining the Comment Form

  • Replaced the comment label with a placeholder inside the text field.
  • Adjusted the width (w-2/3) for better visual balance.
  • Added screen reader (sr-only) accessibility for hidden elements.

Now, the comment form is cleaner, more intuitive, and more accessible.

Final UI Polish

  • Added spacing (space-y-4) between comments for better readability.
  • Future improvements: Add metadata for comments (author, timestamp, etc.) in upcoming refinements.
  • Committed all styling changes to the Git repository—you can follow along with the commits.

This update significantly improves the usability and aesthetics of the post show page, but there’s more UI polish to come.