Cesare Ferrari

May 4, 2024

Trying to keep up with my work hours I want to do didn't work out very well the first day, and even today. I worked probably half of the time I wanted to commit to working. Some of it is my fault, I am a procrastinator. Some of it is unexpected things happening, like hitting problems while creating the cover for my KDP book. I still di...
Read more
May 2, 2024

Time tracking using my watch

I need some sort of time tracking to keep me accountable with my daily activities. I tried time tracking software before, but I seem not to be able to make it stick for one reason or another. Mostly because I keep forgetting to activate and deactivate. I know I have to make it simple, or I won't use it. So I am going to just set up a c...
Read more
May 2, 2024

Planning my time

This is how I plan to spend my time going forward. • First hour of the day: Book publishing • Next 3 hours: Primary earning activity • Next 2 hours: Secondary earning activity Learning throughout the day • Shopify • Analytics • Rails • Book publishing business with KDP Book publishing with KDP is the activity that will provide my incom...
Read more
May 1, 2024

May 1st

Today is May 1st, Worker's Day. I shouldn't work. Poster commemorativo per la festività del 1 Maggio 2014, Festa dei lavoratori. Poster design: F. Piazza, Corso di Progettazione Grafica 1, a.a. 2013/2014
Read more
April 30, 2024

Dinner at the Chinese Restaurant

We had dinner at the Chinese restaurant last Friday. I had chicken with hot peppers: Estelle had chicken with mushrooms: And Mary had sweet and sour chicken:
Read more
July 26, 2022

Testing Hotwire: creating a new document

In the previous post I started creating a Document model, to represent a document upload file. The model has a name, a description, and will have an attached file upload feature in the final version. I have shown how to test and create a functionality to view details of a document by clicking on a list of existing documents. In this po...
Read more
July 25, 2022

Testing Hotwire

Let’s see how to test views that have Turbo frames updated with Hotwire. I am now generating a model in my Rails application. The model name is Document and it represents a document. Ultimately, the document will have an actual uploaded file, but for now, the Document model will only have a name and a description. rails g model Documen...
Read more
July 22, 2022

Rails Turbo frames: how to update a different frame

We have already seen that how to update a Turbo frame by clicking on a link. As long as the link is inside a turbo-frame element and the server response also contains a turbo-frame with the same id, Turbo Drive will update the first turbo-frame with the content of the second one. But how do we update a different frame in the originatin...
Read more
July 21, 2022

Working with Turbo Frames in a Rails application

Turbo frames let you divide an HTML page into discrete sections that can be updated independently from the rest of the page. These sections are represented by turbo-frame custom HTML elements with unique id attributes. To create turbo-frames we use the turbo_frame_tag helper in a Rails view with a syntax similar to this: <%= turbo_fram...
Read more
July 20, 2022

How to disable Turbo Drive in a Rails application

Turbo Drive intercepts link clicks and form submissions and generates Ajax calls to speed up page refresh. It comes enabled by default in a Rails 7 application. Sometimes, though, we may be in a situation where we need to disable Turbo Drive in order to force a full page refresh when we click a link or submit a form. To disable Turbo D...
Read more
July 19, 2022

What is Turbo Drive

Turbo Drive is a technology implemented in Ruby on Rails that speeds page loads. It does so by intercepting link click and form submission events and converting them to Ajax requests to the server. It then takes the HTML responses returned by the server as a result of these requests and updates the <body> of the page in the browser, so...
Read more
July 13, 2022

Connecting to localhost with a phone to view my Rails site in development

Problem: I want to view a Rails website during development on localhost using my phone browser. Bind Rails to IP address Start a Rails server binding to 0.0.0.0 . The server will listen to port 3000 by default (but it can be changed with the -p flag): rails s -b 0.0.0.0 => Booting Puma => Rails 7.0.2.2 application starting in developme...
Read more