mirror of
https://github.com/metosin/reitit.git
synced 2025-12-22 18:41:10 +00:00
Merge pull request #458 from pariyatti/restful_forms_doc_fix
Downcase hidden methods in RESTful example
This commit is contained in:
commit
8be1b16cc7
1 changed files with 4 additions and 3 deletions
|
|
@ -8,9 +8,10 @@ We can do this with middleware in reitit like this:
|
||||||
```clj
|
```clj
|
||||||
(defn- hidden-method
|
(defn- hidden-method
|
||||||
[request]
|
[request]
|
||||||
(keyword
|
(some-> (or (get-in request [:form-params "_method"]) ;; look for "_method" field in :form-params
|
||||||
(or (get-in request [:form-params "_method"]) ;; look for "_method" field in :form-params
|
(get-in request [:multipart-params "_method"])) ;; or in :multipart-params
|
||||||
(get-in request [:multipart-params "_method"])))) ;; or in :multipart-params
|
clojure.string/lower-case
|
||||||
|
keyword))
|
||||||
|
|
||||||
(def wrap-hidden-method
|
(def wrap-hidden-method
|
||||||
{:name ::wrap-hidden-method
|
{:name ::wrap-hidden-method
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue