Alexandre Ruban

March 2, 2022

Hotrails.dev - Two new chapters and one addition to a previous chapter

Hello everyone! 👋

I just released two new chapters on hotrails.dev! I also added a small section to chapter 4 for users of our quote editor to be able to "close" forms.

New chapters release

The first chapter is about flash messages and implementing them in a Ruby on Rails application that uses Turbo.

The second chapter is about two ways to add empty states to our quote editor with Turbo. The first method uses Turbo Frames and Turbo Streams and is well suited for most situations. The second method uses the CSS `:only-child` pseudo-class and is appropriate for cases involving broadcasting, such as notifications.

Closing forms section

I also added a very short section on chapter 4 to add a "Cancel" button on the create and edit forms for quotes. The title of the section is "Adding a cancel button" (sorry, there are no anchors on titles yet!). It is just one line of code to be able to "close" forms without submitting them. Here is a picture of what to expect:

Cancel buttons on forms.png


Next chapters

There are only four more chapters to go! In the following three chapters, we will build the `Quotes#show` page with the line items, and in the last chapter, we will deploy our application to Heroku!

That's all for today! Next time you hear from me, it will be with brand new chapters!

Until next time!