Question templates live in lib/smart_answer_flows/<flow-name>/questions/<question-name>.govspeak.erb
.
The templates can contain content for any of the following keys:
- Valid for all question types
text
argument is a String- Used as the heading (currently "h2")
- Valid for multiple choice & checkbox question types
hash
argument is aHash
of option keys (strings) and text values (also strings)- Used to "translate" options keys for multiple choice & checkbox questions into human-friendly text
- Valid for all question types
text
argument is a String- Used as a "hint" paragraph
- Valid for value questions
text
argument is a String- Used as a label (preceding the input control)
- Valid for value questions & money questions
text
argument is a String- Used as the label (following the input control)
- Valid for all question types
govspeak
argument is a String in Govspeak format- Used to generate the main content (appearing above the input control, e.g. text input element)
- Valid for all question types
govspeak
argument is a String in Govspeak format- Used to generate supplementary content (appearing below the input control)
- Valid for all question types
message
argument is a String- Error message for the default validation error key
- Valid for all question types
message
argument is a String- Error message for a custom validation error key
- Any key can be used, but by convention the
error_
prefix is used
<% content_for :title do %>
How much milk proteins does the product contain?
<% end %>
<% options(
"0": "0-2.49",
"2": "2.5-11.99",
"12": "12 or more"
) %>
<% content_for :hint do %>
The values represent % by weight
<% end %>