daijinara
Joined 11/27/2020
daijinara said almost 4 years ago on Deeper Dive into StimulusJS :
better to put this line of code.

import Rails from "@rails/ujs";

Otherwise, Rails.ajax call will be undefined.

Also, adding the intergration with select2 would be better, since it does not fire native events. 


daijinara said almost 4 years ago on Deeper Dive into StimulusJS :
 For people like me who is hobbyist and only learned functional language such as ruby,  I really appreciate your teaching style in explaining each line of codes on the city_selector_controller.js. :)

daijinara said almost 4 years ago on Deeper Dive into StimulusJS :
For those seeking to integrate select2, add this code below:

initialize() {
    console.log('hello from city-selector controller')

    $("#state_id, #county_id").on('select2:select', function () {
      let event = new Event('change', { bubbles: true }) // fire a native event
      this.dispatchEvent(event);
    });

    this.check_forms()    
  }

daijinara said almost 4 years ago on Cropping Active Storage Uploads :
  Do you think your solution works on cloud storage service? Because I understand that re-sizing the image only works after the image is uploaded
. How do you return the getURL() if you use cloud storage service like S3? Or this solution is only for local disk service?

daijinara said over 3 years ago on Cropping Active Storage Uploads :
  your original code works better on positioning. 

(crop_width + crop_x).to_f,
(crop_height + crop_y).to_f