I was working on ajax on my rails app and I got a ActionController::InvalidAuthenticityToken error.
and I read this
config.action_view.embed_authenticity_token_in_remote_forms allows you to set the default behavior for authenticity_token in forms with remote: true. By default it's set to false, which means that remote forms will not include authenticity_token, which is helpful when you're fragment-caching the form. Remote forms get the authenticity from the meta tag, so embedding is unnecessary unless you support browsers without JavaScript. In such case you can either pass authenticity_token: true as a form option or set this config setting to true.
from RailsGuides
so I add config.action_view.embed_authenticity_token_in_remote_forms=true
to \config\application.rb
and restart rails server ,then an error happened
/Users/haha/railsbridge/railsfun/ruby12weeks/eat/config/application.rb:5:in': undefined local variable or method config' for main:Object (NameError)
Did I put it to wrong place?
this is my github