question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Integrating Stimulus with Ruby on Rails - Getting Started

See original GitHub issue

A humble hello to whoever may be reading this. I can’t tell you how excited I am for this framework. As an independent rails developer sprinkles of JS turn to spaghetti really quickly, this seems perfect.

My question:

Where does the Stimulus team recommend as best practice to put the JS controller files? For example, if I wanted to integrate a version of this walkthrough into an existing rails app.

I’ve spent the last hour + trying to integrate Stimulus into a demo rails 5 app and I can’t seem to get things wired up. I get the initializing Content Script message listener in my console but I can’t seem to make the controller actions fire. I think it’s because I’m not putting these controllers in the right place?

Thanks so much any help is greatly appreciated.

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Reactions:7
  • Comments:12

github_iconTop GitHub Comments

17reactions
Johnsalzarulocommented, Jan 14, 2018

Thank you! @pacMakaveli and @dixpac you guys are awesome.

Totally what I needed to get things up and running!

stimulus

Thanks again.

14reactions
celestekingcommented, May 21, 2019

stimulusjs comes from Rails team yet there’s nothing in https://stimulusjs.org/handbook/installing on installing it on Rails. This is bullshit. Either stick to your values or ditch them. There’s nothing about webpack on https://edgeguides.rubyonrails.org/asset_pipeline.html page. Again, you should pick a strategy and hold onto it.

Read more comments on GitHub >

github_iconTop Results From Across the Web

How To Add Stimulus to a Ruby on Rails Application
In this tutorial, you will install and use Stimulus to build on an existing Rails application that offers readers information about sharks.
Read more >
How to Add Stimulus.js to a Rails 6 Application
Step 1: Add Stimulus to the application via yarn or npm · Step 2: Set up Stimulus with Webpacker · Step 3: Add...
Read more >
Add a Stimulus Controller for Client-Side Interaction - YouTube
This is the 27th video in the Getting Started with Rails 7 series. In this video Mike adds an element with a Stimulus...
Read more >
How To Install Stimulus In a Rails App - MagmaLabs Blog
In this tutorial, you will install Stimulus using Webpacker and Rails 7. If your Rails app is is not using the Webpacker gem,...
Read more >
Building a simple commenting form with Stimulus and Rails 6
If you use Ruby on Rails, you've probably heard of Stimulus, a “modest” JavaScript framework for sprinkling in small bits of JavaScript to...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found