Return to Snippet

Revision: 52935
at November 6, 2011 15:45 by adeandrade


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

Revision: 52934
at November 6, 2011 15:34 by adeandrade


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

Initial URL

                                

Initial Description
Short yet highly configurable. Great to show off Clojure.

Initial Title
View Helper To Display a Field

Initial Tags

                                

Initial Language
Clojure