@StatelessCode
  @StatelessCode
Stateless Code | Codecast: Getting Started with Rails 7 10: Destroy an Article and Get it Working with Turbo @StatelessCode | Uploaded December 2021 | Updated October 2024, 4 hours ago.
This is the 10th video in the Getting Started with Rails 7 series. In this video Mike follows the Getting Started with Rails guide to implement the destroy action for Articles, but it doesn't work as intended (even though the controller tests are passing). He then tracks down some recent changes to the Markdown for the Getting Started Guide in Rails main and uses the updated version of the getting started guide to get it working with Turbo without Rails Unobtrusive JavaScript.

Mike also makes use of a Rails system test inheriting from ApplicationSystemTestCase that uses Selenium and Chrome to test the Turbo JavaScript interactions in the browser.

This video covers:
00:00:10 Introduction, review previous episodes and overview of intent for this episode
00:05:34 Write failing tests for destroy action and changes to show
00:08:12 Add destroy action (guide version) to ArticlesController and iterate to get destroy test passing
00:09:58 Add destroy link to show.html.erb to get show test passing
00:10:41 Tests passing. Everything is fine. Or is it? Attempt to test in the browser and discover it is not working as intended.
00:12:26 Chase down solution to problem in rails/main version of getting started guide
00:16:31 Update show.html.erb to use turbo_method and turbo_confirm in link_to helper
00:17:24 Update destroy action to redirect with status code 303 :see_other. Action now working as intended
00:19:46 Use a Rails system test driven by a browser to test Turbo confirm and redirect working as intended
00:23:38 Troubleshoot getting test case working on Ubuntu. Install Chrome using .deb file to get it working
00:25:53 Configuration working. Fix incorrect assertion name in test case and get test passing.
00:26:28 Temporarily remove Turbo compliant version of code to demonstrate system tests failing and then incrementally add back in
00:29:07 View screenshots of system test case failures in tmp/screenshots folder of project directory
00:29:59 Review, commit, and push code

This video is CC0 - No rights reserved. (YouTube doesn't allow this option when publishing.) All code is released under the UNLICENSE. Stateless Code denies the concept of "intellectual property". Copying is not stealing.
Codecast: Getting Started with Rails 7 10: Destroy an Article and Get it Working with TurboCreate a RubyGem 94: Fix a Cognitive Complexity Code Smell from Code ClimateConfigure Devise Settings and Add Environment-Specific Rails CredentialsCodecast: Install Rails 6, PostgreSQL 13, MariaDB 10.5Install balenaEtcher on Ubuntu 22.04Inkscape 07: Create a logo for the statelesscode.com WordPress SeriesUpgrade to Devise 4.9 on Rails 7 and Decommission the 4.8 HacksCodecast: Create a RubyGem 56: Refactor roll_ability_scores SpecsCodecast: Getting Started with Rails 7 24: Use ActionText for Rich Text ContentCreate Pre and Post Sign-In Pages to Test DeviseInstall VirtualBox 7 on Ubuntu, Windows, and Intel MacCodecast: Getting Started with Rails 7 27: Add a Stimulus Controller for Client-Side Interaction

Codecast: Getting Started with Rails 7 10: Destroy an Article and Get it Working with Turbo @StatelessCode

SHARE TO X SHARE TO REDDIT SHARE TO FACEBOOK WALLPAPER