DEV Community

Discussion on: ActionController:: InvalidAuthenticityToken — What's Going On Here?

Collapse
 
bobwalsh47hats profile image
Bob Walsh

The behavior I was getting was ActionController::InvalidAuthenticityToken Error for no good reason. Tried a bunch of different things in my application_controller, none worked consistently.

What I found was with SR-enabled rails apps, you want to a) turn on caching in development and b) flush that cache if you are trying out different SR-enabled rails apps by toggling rails dev:cache a few times then doing rails s.

This especially works if you try running a second SR-enabled rails app, either one after another or both at the same time (on different rails instances, using rails s -p 3001).

This particular rat hole is easy to fall into and very, very hard to climb out of.