jkrall / analytical

Gem for managing multiple analytics services in your rails app.
MIT License
381 stars 93 forks source link

First line in header causes "undefined method `merge' for nil:NilClass" #74

Closed ACPK closed 10 years ago

ACPK commented 10 years ago

Since we use HAML, I added the line below to the beginning of my header but it causes an "undefined merge issue".

= raw analytical.head_prepend_javascript

sfsekaran commented 10 years ago

Can you reproduce it in a newly generated rails app?

tristanm commented 10 years ago

I ran into this issue when the analytical macro hadn't been called on a particular controller that didn't inherit from ApplicationController. For me the fix was simple: make sure analytical was called in all controllers, not just those inheriting from ApplicationController.

sfsekaran commented 10 years ago

Makes sense. Closing this for now. If anyone has a good workaround or a better error message for analytical.head_prepend_javascript, please send in a pull request!