This is the 9th video in the Getting Started with Rails 7 series. In this video Mike implements the edit and update actions, refactors repeated form code from the new and edit views into a form view partial, and refactors repeated code in the ArticlesControllerTest into shared assertion helper methods.
This video covers:
- 00:00:10 Introduction
- 00:01:21 Add failing tests for edit and update to
ArticlesControllerTest - 00:06:01 Add
editandupdateactions to the controller - 00:09:00 Create
edit.html.erbview file and add incrementally add code to get the tests passing. - 00:11:55 Refactor repeated form code in
newandeditto_form.html.erbpartial - 00:16:10 Demonstrate the refactored
newandeditactions working in the application - 00:17:48 Add test and view code to include
editlink in theshowaction - 00:19:45 Refactor
ArticlesControllerTestto move repeated code to setup and private shared assertion helper methods - 00:26:58 Review, commit, and push code
The code for this series is open source and available on GitHub. View the commit for this video here.
