Method: Rack::Request::Helpers#delete_param
- Defined in:
- lib/rack/request.rb
#delete_param(k) ⇒ Object
Destructively delete a parameter, whether it’s in GET or POST. Returns the value of the deleted parameter.
If the parameter is in both GET and POST, the POST value takes precedence since that’s how #params works.
env['rack.input'] is not touched.
589 590 591 592 |
# File 'lib/rack/request.rb', line 589 def delete_param(k) post_value, get_value = self.POST.delete(k), self.GET.delete(k) post_value || get_value end |