EDISON J
EDISON J

Reputation: 344

stimulus-rails is not working after adding spree in the rails application

I have built a Rails application (7.1.3.4) and called stimulus hello controller using button click event it works as expected.

//hello_controller.js

import { Controller } from "@hotwired/stimulus"
export default class extends Controller {
  clickHandler(){
    console.log('Click handler is called');
  }
}

Button click event in users/index.html.erb file.

<div data-controller='hello'>
   <button data-action="click->hello#clickHandler"> Click Here </button>
</div>

It works as expected. But when I add spree in that rails application this button click event does not work.

This is the link I have followed for the Spree installation. https://docs.spreecommerce.org/developer/getting-started/adding_spree_to_rails_app#adding-sample-data

Anyone, please help with this?

Upvotes: 1

Views: 47

Answers (0)

Related Questions