Thomas Van Holder


3,010 Experience
29 Lessons Completed
0 Questions Solved


great timing!

Posted in How to create a live countdown clock?

Hi Samuel,

I've ended up using vanilla JS. However, you could do the same with Stimulus, that's what I would do when rebuilding it.

Here's roughly the outline of the code that was used.

Posted in Testing API Integrations with WebMock Discussion

This might help someone watch the video. The website provided ( didn't work for me. The following error occurred:

SocketError: Failed to open TCP connection to (getaddrinfo: nodename nor servname provided, or not known)

Swapping the website for and all works well.

Posted in How to create a live countdown clock?

Hi all,

We're creating an online auction which has a countdown clock on the show page of a listing.
The timer counts down every second, just like this example:
I've been looking at Stimulus Reflex, classic JS and action cable.
What's the best way to build this with rails?

Thanks for your feedback.

Posted in How can i create a contact form in rails.

For anyone else looking to implement a contact from.
Mail_form is indeed an easy way to do it.
I followed this guide and got implementation up and running in 20m.

Another possibility to add in Trix into your project is following the 2 steps in the installation guide.

The dynamic dropdown with Stimulus JS was a feature I spend a lot of time trying to solve, eventually got it working like this.

import { Controller } from "stimulus";

export default class extends Controller {
  static targets = [   

updateRooms() {
    const property_id = this.targets.find("property_id").value;
      type: "GET",
      url: "/get_rooms.json",
      data: "property_id=" + property_id,
      success: (data) => {

  updateDropdown(data) {
    this.roomIdTarget.innerHTML = "";
    const num_rooms = data;
    if (num_rooms == 0) {
      const option = document.createElement("option");
      option.innerHTML = "Entire place";
    } else {
      data.forEach((room) => {
        const option = document.createElement("option");
        option.value =;
        option.innerHTML = "Room " +;

Screencast tutorials to help you learn Ruby on Rails, Javascript, Hotwire, Turbo, Stimulus.js, PostgreSQL, MySQL, Ubuntu, and more.

© 2024 GoRails, LLC. All rights reserved.