Posted By

adeandrade on 11/06/11


Tagged

clojure web-development


Versions (?)

View Helper To Display a Field


 / Published in: Clojure
 

Short yet highly configurable. Great to show off Clojure.

  1. (defpartial display-field
  2. [value &
  3. {:keys [label message layout]}
  4. {:or {message "Not Available" layout #(vector (:p [:strong %1] %2))}}
  5. {:pre [(not (and (blank? label) (blank? message)))]}]
  6. (when message (layout label (first (remove blank? (value message))))))

Report this snippet  

You need to login to post a comment.