I just changed in my local development laptop fro开发者_如何学Pythonm WEBrick to Apache2/Passenger. Now I got
ActionController::InvalidAuthenticityToken in SessionsController#create
I'm using Ruby 1.9.2 Rails 2.3.8 ubuntu 10.04
I tried both
protect_from_forgery, :only => [:update, :delete, :create]
and
skip_before_filter :verify_authenticity_token
in my applicaiton_controller.rb
They didn't seem to help. (BTW, should I have restarted Passenger somehow after modifying applicaiton_controller.rb?)
Any help would be appreciated.
If you're using the default Passenger setup, it runs your application in the production environment - this usually means class caching is turned on. You'll need to restart your Passenger worker when you make config or code changes like the ones you described via:
touch tmp/restart.txt
Additionally, you can switch your Passenger configuration to run in Development environment via the following Passenger config:
RailsEnv development
精彩评论