Mike Does Tech

Cells and Rails 2.0 request forgery protection

Posted by: mikepence on: April 9, 2008

If you have been using Cells much with Rails 2.0, you may have come upon a problem with Rails form helpers requiring access to ActionController’s RequestForgeryProtection methods. We’ll be incorporating a fix into Cells for this in the next couple of days, meanwhile, thanks to Paul Dix for identifying a workaround.

In your Cell controller, add this:

include ActionController::RequestForgeryProtection

def allow_forgery_protection
  ActionController::Base.allow_forgery_protection
end

def request_forgery_protection_token
  form_authenticity_token
end

Leave a Reply