Uploaded December 2021 | Updated November 2026, 3 days ago
This is the 8th video in the Getting Started with Rails 7 series. In this video Mike demonstrates that you can currently create an Article record with an empty title and body. In order to solve the problem, he uses Rails model validations to ensure the data for the Article record is in good order before trying to save to the database. He first creates failing tests in the ArticleTest model test class and then adds in the validations to make them pass. After that, he adds embedded Ruby to the new view template to display the error messages in the view if any exist.
This video covers:
00:00:10 Introduction and demonstrate lack of validations
00:02:55 Write failing model tests in ArticleTest class, both happy and unhappy paths
00:09:13 Add validations to the article model incrementally to make tests pass
00:11:27 Review the validation error message view code in the guide
00:17:30 Add test for bad parameters to ArticlesControllerTest and troubleshoot assert_select unexpected behavior. Solve by adding classes to the error message divs.
00:24:10 Add back in the error messages to the view to make the tests pass and explore in the application UI
00:25:05 Review the rest of this section of the guide. Demonstrate preservation of bad form input data if invalid
00:25:50 Add link_to helper in articles index view to new article form
00:29:11 Review, commit, and push the 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.
This is the 8th video in the Getting Started with Rails 7 series. In this video Mike demonstrates that you can currently create an Article record with an empty title and body. In order to solve the problem, he uses Rails model validations to ensure the data for the Article record is in good order before trying to save to the database. He first creates failing tests in the ArticleTest model test class and then adds in the validations to make them pass. After that, he adds embedded Ruby to the new view template to display the error messages in the view if any exist.
This video covers:
00:00:10 Introduction and demonstrate lack of validations
00:02:55 Write failing model tests in ArticleTest class, both happy and unhappy paths
00:09:13 Add validations to the article model incrementally to make tests pass
00:11:27 Review the validation error message view code in the guide
00:17:30 Add test for bad parameters to ArticlesControllerTest and troubleshoot assert_select unexpected behavior. Solve by adding classes to the error message divs.
00:24:10 Add back in the error messages to the view to make the tests pass and explore in the application UI
00:25:05 Review the rest of this section of the guide. Demonstrate preservation of bad form input data if invalid
00:25:50 Add link_to helper in articles index view to new article form
00:29:11 Review, commit, and push the 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.









![Install Git on Ubuntu 24.04 and Configure for Verified Commits in GitHub
Git is an open source distributed version control system that is the most widely used by software developers today. Its decentralized nature makes it essentially censorship-proof and very robust against accidental deletion or permanent loss of work. Even if somebody accidentally deletes the remote repository entirely, each member of the team has a full version of the project and can just create another one.
In this video, we install Git on a mostly fresh copy of Ubuntu 24.04 (with Visual Studio Code installed). Because we want to use Git with GitHub and get that sweet-sweet Verified tag on our commits, we install git along with the dependencies needed for git-credential-libsecret:
`sudo apt install make gcc git libsecret-1-0 libsecret-1-dev libglib2.0-dev`
After installing Git, we do some basic global configuration, (including enabling rerere, youll thank me later), create a GPG signing key, upload that signing key to GitHub, and create a GitHub access token with repo access.
We use git-credential-libsecret to improve security so we dont have the access token stored in plain text somewhere on the hard drive.
This video covers:
00:00:00 Introduction and overview of Git
00:03:41 Install Git along with libsecret dependencies
00:04:53 Post install verification and initial global config setup
00:07:50 Create a basic local repo to make sure local committing works
00:10:40 Set up GPG key so commits can be signed.
00:16:04 Add the GPG key to the GitHub account
00:18:11 Configure git-credential-libsecret as the credential helper
00:19:56 Generate a GitHub access token
00:22:33 Clone a remote repo and create a commit on a throwaway branch to test the token and signature
00:25:20 Copy the generated access token and use it to authenticate when pushing
00:26:11 Look in GitHub to ensure the commit shows as verified and then remove the throwaway branch from the remote.
00:27:43 Review the option to always sign commits `git config [ global] commit.gpgsign true`
00:29:14 Closing comments
#setup #configuration #install #linux #ubuntu #debian #deb #terminal #ubuntu24 #lts #github #code #visualstudiocode #vscode #apt #git #libsecret #gpg #verifiedcommit #rerere #versioncontrol #sourcecodemanagement #scm
See other related StatelessCode videos:
- Install Visual Studio Code on Ubuntu 24.04 https://youtu.be/GdmHY1JhLI8
- Set up a GitHub Profile README for an Organization https://youtu.be/hqFq-2yqPZM
- Install Ubuntu 24.04 LTS Desktop https://youtu.be/yHxuNUovS20
Featured Playlist:
- Ruby on Rails NerdDice.com https://youtube.com/playlist?list=PL9kkbu1kLUeMJFb0GT8ZMzrsSKJaxjOKH
Resources that we relied upon for this solution:
- Git homepage https://git-scm.com/
- GitHub: Managing commit signature verification https://docs.github.com/en/authentication/managing-commit-signature-verification
- Storing your GIT credentials in libsecret https://gist.github.com/JonasGroeger/4393203cc846da558fec1531cdd822db
- Git Tools - Rerere https://git-scm.com/book/en/v2/Git-Tools-Rerere
This video is CC0 - No rights reserved. (YouTube doesnt allow this option when publishing.) All code is released under the UNLICENSE. Stateless Code denies the concept of intellectual property. Copying is not stealing. Install Git on Ubuntu 24.04 and Configure for Verified Commits in GitHub](https://i.ytimg.com/vi/CagiEjuqKxU/mqdefault.jpg)
