Lucius Choi

Joined

1,990 Experience
18 Lessons Completed
0 Questions Solved

Activity

When I use webpacker gem, it is so easy to install stimulus reflex using stimulus_reflex gem in Rails 6.
But in Rails 7, some problems occurs as follows:

$ bundle add stimulus_reflex
$ rails stimulus_reflex:install

yarn add v1.22.17
[1/4] 🔍  Resolving packages...
[2/4] 🚚  Fetching packages...
[3/4] 🔗  Linking dependencies...
warning " > stimulus_reflex@3.4.1" has unmet peer dependency "stimulus@>= 1.1".
[4/4] 🔨  Building fresh packages...
success Saved lockfile.
success Saved 4 new dependencies.
info Direct dependencies
└─ stimulus_reflex@3.4.1
info All dependencies
├─ @rails/actioncable@7.0.0
├─ cable_ready@4.5.0
├─ morphdom@2.6.1
└─ stimulus_reflex@3.4.1
✨  Done in 3.13s.
rails aborted!
Dont know how to build task 'webpacker:install:stimulus' (See the list of available tasks with `rails --tasks`)

(See full trace by running task with --trace)
mkdir -p /Users/lucius/Projects/myrails/r7/eLearning/app/javascript/controllers
mkdir -p /Users/lucius/Projects/myrails/r7/eLearning/app/reflexes
Updating /Users/lucius/Projects/myrails/r7/eLearning/app/javascript/controllers/index.js
      create  app/reflexes/application_reflex.rb
      create  app/javascript/controllers/application_controller.js
      create  app/reflexes/example_reflex.rb
      create  app/javascript/controllers/example_controller.js
Generating default StimulusReflex configuration file into your application config/initializers directory
      create  config/initializers/stimulus_reflex.rb

StimulusReflex and CableReady have been successfully installed!
Go to https://docs.stimulusreflex.com/quickstart if you need help getting started.

Maybe, I think it is caused by using esbuild not webpack.
What should I do ? Please.

p.s. javascript/channel/consumer.js not created.

When I upgrade stimulus.js version up to 2.0 and define static values object, the following error occurs:

Uncaught TypeError: _this.data.getAttributeNameForKey is not a function
    at value_properties.js:13
    at Array.reduce (<anonymous>)
    at extended.get (value_properties.js:10)
    at new ValueObserver (value_observer.js:7)
    at new Context (context.js:9)
    at Module../node_modules/@stimulus/core/dist/module.js.Module.fetchContextForScope (module.js:46)
    at Module../node_modules/@stimulus/core/dist/module.js.Module.connectContextForScope (module.js:32)
    at Router../node_modules/@stimulus/core/dist/router.js.Router.scopeConnected (router.js:92)
    at ScopeObserver../node_modules/@stimulus/core/dist/scope_observer.js.ScopeObserver.elementMatchedValue (scope_observer.js:41)
    at ValueListObserver../node_modules/@stimulus/mutation-observers/dist/value_list_observer.js.ValueListObserver.tokenMatched (value_list_observer.js:44)

Is there any solution for this?

ps: I have already installed stimulus(2.0.0) and stimulus_reflex(3.4.0)

export default class extends ApplicationController {
  static values = {
    departmentIds: Array,
    profileIds: Array,
    basicProfileId: Number,
  };
...

I'm using wicked_pdf gem for rendering show template view with PDF format.
But, unfortunately, awesome fonts were not shown but blank space.
Is any solution for this?

Thank you in advance.

Posted in Pretty urls with FriendlyID Discussion

How can I solve the problem on parameterizing two-byte characters (ex. Korean, Japanese, Chinese). Would you hint me to solve it?

Posted in Multiple File Uploads with Shrine Discussion

Thank you.

Posted in Multiple File Uploads with Shrine Discussion

One more question please...
I would like to get the cropping dimension from user input values and then update the image. In this case, how can I implement using recache plugin. Thank you in advance.

Posted in Multiple File Uploads with Shrine Discussion

I'm sorry but what does it mean "promote"?

Posted in Multiple File Uploads with Shrine Discussion

Thank you so much. I'll try and notice you the result.

Posted in Multiple File Uploads with Shrine Discussion

I want to crop uploaded image or cached image before uploading. I tried it on "after_update" callback but it is difficult to reupload the UploadedFile after cropping. Wound you give me a hint for this?

Posted in Multiple File Uploads with Shrine Discussion

Thank you for your kind answers.

Posted in Multiple File Uploads with Shrine Discussion

How should I change the update.js on using the versions plugin? And I can't see the progress bar in Bootstrap 4 and so any solution?

logo Created with Sketch.

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

© 2022 GoRails, LLC. All rights reserved.