Skip to content

Instantly share code, notes, and snippets.

@brentonashworth
Created April 19, 2011 04:42
Show Gist options
  • Save brentonashworth/926824 to your computer and use it in GitHub Desktop.
Save brentonashworth/926824 to your computer and use it in GitHub Desktop.
Add request header into to form input
(defform foo-form "/foo"
:fields [(hidden :id)
(hidden :remote-addr)
(textfield "Enter Your Foo" :foo)]
:on-cancel "/"
:on-success
#(do
(flash-put! :message (str %))
"/")
:defaults (fn [request]
{:foo "bar"
:remote-addr (:remote-addr request)}))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment