Relative Content

Tag Archive for javascriptruby-on-railshotwire-rails

Unable to reference a function from a javascript controller with hotwire/stimulus

I’m not sure if this is a local setup issue, or if it’s a code issue, but I’m having trouble using a new function on an existing controller. It’s possible this controller was never successfully being imported in the first place. Even after having the controller specified in the layout and referencing it in the view, I’m being told that it’s referencing an undefined method:

Unable to reference a function from a javascript controller with hotwire/stimulus

I’m not sure if this is a local setup issue, or if it’s a code issue, but I’m having trouble using a new function on an existing controller. It’s possible this controller was never successfully being imported in the first place. Even after having the controller specified in the layout and referencing it in the view, I’m being told that it’s referencing an undefined method: