Skip to content
Advertisement

Tag: stimulusjs

How to run a single-file javascript soundboard app from Rails 7

I have a single-file Javascript soundboard application from app academy. The code works fine, but how do I “wire” it into the Rails 7 server? I’m struggling to bridge my understanding between frontend javascript and backend Rails. It runs if I paste the contents into app/javascript/application.js but I want to keep it a separate file: ‘app/javascript/soundboard/soundboard.js’ I am starting from

Stimulus.js call method defined in connect() lifecycle callback

Im still learning stimulus.js and I’m trying to expand on the DriftingRuby episode on stimulusJS and FullCalendar. In that tutorial the form submits a normal http put request and the page is reloaded. I’d like to allow users to manage events using UJS/Stimulus and not requiring a page reload. This is my calendar_controller.js I need to call the add_event method

Advertisement