Skip to content

Instantly share code, notes, and snippets.

@bratsche
Created December 31, 2013 06:23
Show Gist options
  • Save bratsche/8193328 to your computer and use it in GitHub Desktop.
Save bratsche/8193328 to your computer and use it in GitHub Desktop.
# In production mode
2.1.0 :001 > p = { a: 1, b: 2, c: 3 }
=> {:a=>1, :b=>2, :c=>3}
2.1.0 :002 > params = ActionController::Parameters.new(p)
=> {"a"=>1, "b"=>2, "c"=>3}
2.1.0 :003 > params.permit(:a)
=> {"a"=>1}
2.1.0 :004 >
# In development mode
2.1.0 :001 > p = { a: 1, b: 2, c: 3 }
=> {:a=>1, :b=>2, :c=>3}
2.1.0 :002 > params = ActionController::Parameters.new(p)
=> {"a"=>1, "b"=>2, "c"=>3}
2.1.0 :003 > params.permit(:a)
Unpermitted parameters: b, c
=> {"a"=>1}
2.1.0 :004 >
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment