pub fn class_names(classes: &[(&str, bool)]) -> StringExpand description
Space-separated class names whose condition is true (Rails’ class_names / token_list).
In a template (askama passes the array by reference):
<a class="{{ ocre::helpers::class_names([("tab", true), ("active", is_current)]) }}">.
§Examples
let classes = ocre::helpers::class_names(&[("btn", true), ("btn-danger", false), ("wide", true)]);
assert_eq!(classes, "btn wide");