Skip to content

Getting Started with Rails 7 Episode 14: Refactor into Comment Partials

This is the 14th video in the Getting Started with Rails 7 series. In this video Mike starts section 9 of the Getting Started guide on refactoring. He makes use of the previously introduced concept of partials to refactor the comment display and the comment form into partials that the articles show view renders.

This video covers:

  • 00:00:10 Introduction and review of previous episodes
  • 00:02:29 How a test driven approach enables successful refactoring
  • 00:04:03 Refactor the display of each comment into a _comment.html.erb partial
  • 00:08:09 Refactor the comment form into a partial (using local variables instead of instance variables)
  • 00:14:30 Review, commit, and push code

The code for this series is open source and available on GitHub. View the commit for this video here.

Leave a Reply