Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
# Tell controller not to check for authenticity token:
Rails.configuration.action_controller.allow_forgery_protection = false
# Create a session:
app =
# Setup parameters from log:
params = {"start_date"=>"2010-04-15", "end_date"=>"2010-04-15", "commit"=>"Create", "event"=>{"title"=>"Brain Silo Hackfest/Open House", "url"=>"", "venue_id"=>"202392003", "description"=>"The silo is open to any interested parties who want to hack or just check out the space during the welcome meeting. <b>This is an Open House meeting</b>\r\n\r\nNOTE: The entrance for the space is on the backside of the building in the alley -- NOT at the mailing address. See this satellite view for clarification:\r\n\r\nThe outside door is at the top of a set of stairs. The space is marked with a small sticker that is labeled \"BrainSilo\"\r\n", "tag_list"=>"brainsilo, hackfest"}, "venue_name"=>"bRainSilo", "trap_field"=>"", "start_time"=>"07:00 PM", "end_time"=>"08:00 PM"}
# Remove the authenticity token, because if it's listed, it'll be checked:
params.delete "authenticity_token"
# Try to invoke the controller method EventsController#create with the given parameters:
puts '/events', params
# If run via "script/runner", the above fails with a 422 error, likely because of the authenticity token.
# If run via "script/console", the above fails with this error:
### ThreadError Exception: thread 0x8212138 tried to join itself
# And this error is likely this Rails 2.3.x bug:
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment