0

I started code rails recently and I need to figure out this problem.

I use this function especially for my project. So i customize name and properties variables.

ahoy.track(name, properties);

In local there is no problem but in the live version when the tracking method runs i received 404 error. This line create A POST request to /ahoy/events and there is no path /ahoy/events in the live version.

Emre
  • 119
  • 2
  • 8

2 Answers2

1

Hi everyone i try a lot and finally i found solution. Meanwhile this issue helped me a lot.

I modify only two files in my project.

ahoy.rb

  mattr_accessor :auto_mount
  self.auto_mount = false

routes.rb

mount Ahoy::Engine => "/ahoy", as: :my_ahoy
Emre
  • 119
  • 2
  • 8
0

The Ahoy routes get activated only when Ahoy.api is true. In config/initializers/ahoy.rb make sure to have

Ahoy.api = true

ref here