Thomas Van Holder


1,490 Experience
14 Lessons Completed
0 Questions Solved


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 " +;

Really cool.

logo Created with Sketch.

Ruby on Rails tutorials, guides, and screencasts for web developers learning Ruby, Rails, Javascript, Turbolinks, Stimulus.js, Vue.js, and more. Icons by Icons8

© 2020 GoRails, LLC. All rights reserved.