Hobo Cookbook

View Source

Rapid

<field-list>

Renders a table with one row per field, where each row contains a <th> with the field name, and a <td> with (by default) a <view> of the field.

Parameters

  • #{scope.field_name.to_s.sub('?', '').gsub('.', '-')}-label
    • label
  • #{scope.field_name.to_s.sub('?', '').gsub('.', '-')}-view
    • view
      • #{scope.field_name.to_s.sub('?', '').gsub('.', '-')}-tag
    • input-help

Attributes

  • fields: Comma separated list of field names to display. Defaults to the fields returned by the standard_fields helper. That is, all fields apart from IDs and timestamps.

  • force-all: All non-viewable fields will be skipped unless this attribute is given

  • skip: Comma separated list of fields to exclude

  • tag: The name of a tag to use inside the <td> to display the value. Defaults to view

  • no-edit: Controls the behavior of <input> tags when the user doesn’t have edit permission for a field.

    • view: render the current value using the <view> tag
    • disable: render the input as normal, but add HTML’s disabled attribute
    • skip: render nothing at all. This will omit the entire row (including the label)
    • ignore: render the input normally. That is, don’t even perform the edit check.
  • no-blanks: (boolean) Controls the behavior of <view> tags. The entire row (including the label) will be omitted if this is blank. Default false.

Example

<field-list fields="first-name, last-name, city">
  <first-name-label:>Given Name</first-name-label:>
  <last-name-label:>Family Name</last-name-label:>
  <city-view:><name-one/></city-view:>
</field-list>

Show Source

Comments

No Comments to display