All Questions
Tagged with ruby-on-rails-7 stimulusjs
56
questions
1
vote
1
answer
200
views
Understanding StimulusJS connect() vs initialize() in context of turbo/hotwire
The Stimulus handbook describes the difference between connect/initialize as:
initialize(): Invoked only once, when the controller is first instantiated
connect(): Invoked anytime the controller is ...
0
votes
1
answer
125
views
Setting button/other element display state based on form input values using Hotwire Stimulus
I have a form which has a text input, a file input, and a submit button.
I want to modify the display of the button in response to input changes, where it should be enabled if either of the input ...
-1
votes
1
answer
89
views
One Stimulus controller not loading after migrating Rails 7 app to importmaps
I am trying to move away from yarn, npm and webpacker to importmaps. I clearly did a lot of things right cause some of my JavaScript is loading. Some of my Stimulus controllers are not being ...
0
votes
0
answers
229
views
How to integrate Alpine.js into a Rails 7 application?
I have a Rails 7 application with Stimulus in it and I downloaded a TailwindCSS template that uses the AlpineJS framework. Apparently, the way I integrated Alpine.JS into the Rails app is not proper, ...
3
votes
1
answer
894
views
Scroll to element after turbo stream is rendered
I made this stimulus controller just so I can get more insight into what events fire and when, this is the connect portion of the controller:
connect() {
console.log("controller connected&...
2
votes
1
answer
1k
views
Rails 7 and Bootstrap error in stimulus - failed to resolve module specifier bootstrap
I am following this tutorial: https://www.hotrails.dev/articles/rails-modals-with-hotwireEverything goes well until I create this stimulus controller file:
import { Controller } from "@hotwired/...
0
votes
0
answers
92
views
how to change swiper-button-prev and next color with swiper in Ruby on rails 7?
I want to change swiper-button-prev and next color with swiper in Ruby on rails 7
My html code
<swiper-container navigation="true" pagination="true" scrollbar="...
0
votes
1
answer
126
views
How to load an Active Storage image into a canvas with a Stimulus controller?
I would like to load the images that users submit into the Stimulus controller so that I can use it within my Three JS (3D JavaScript Library) code. How can I achieve this? I’ve already tried so many ...
1
vote
1
answer
280
views
Turbo Streams in Rails 7
I have been following this tutorial https://www.youtube.com/watch?v=TKIbtbYyRdE&list=PL6SEI86zExmvb4qjVHJWrKRQrKjWksQ81&index=34 followed by its 2nd part
https://www.youtube.com/watch?v=...
1
vote
0
answers
39
views
redirect_to doesnt take effect
I have a controller and inside the controller
def publish
post = Post.find(params[:post_id])
post.update(published: true, published_at: Time.now)
redirect_to edit_post_path(post)
end
def ...
3
votes
1
answer
827
views
Stimulus controller not loading
I'm getting this message on my console and I cannot find a solution:
Failed to register controller: search (controllers/search_controller) TypeError: The 'stimulus' specifier was a simple specifier, ...
1
vote
1
answer
912
views
importmap-rails + sprockets not finding stimulus-loading.js in fresh stimulus-rails installation
Mature app updating to Rails 7.0.7, Ruby 3.1.2, adding stimulus-rails using the installer, with importmap-rails, turbo-rails and sprockets-rails already installed. No custom Stimulus controllers yet, ...
0
votes
2
answers
756
views
How to prevent Turbo progress bar and spinning activity indicator from Rails 7 link_to
I have a Rails 7 app with Turbo and Stimulus. I have a link_to that triggers a controller action but not a render or redirect. The basic functionality is correct, but clicking the link initiates the ...
1
vote
0
answers
76
views
Rails 7 SortableJS
i have a rails app and it contains stripe for payment, my console shows Failed to execute 'postMessage' on 'DOMWindow': The target origin provided ('https://js.stripe.com
') does not match the ...
1
vote
1
answer
240
views
How to disable stimulus:manifest:update when generating a stimulus controller
On Rails 7, when I run rails generate stimulus controller_name, rails stimulus:manifest:update is automatically triggered. Is there any way to disable this hook ?