def request_method(request)
      return request.request_method           if request.request_method != 'POST'
      return request.params['_method'].upcase if request.params['_method']
      request.request_method
    end
def request_method(request)
      return request.request_method           if request.request_method != 'POST'
      return request.params['_method'].upcase if request.params['_method']
      request.request_method
    end
Return HTTP method, detect emulated method with _method param