View Helper To Display a Field

/ Published in: Clojure
Save to your folder(s)

Short yet highly configurable. Great to show off Clojure.

Copy this code and paste it in your HTML
  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


RSS Icon Subscribe to comments

You need to login to post a comment.