Class: View::DefinitionList
- Inherits:
-
Formatter
- Object
- Formatter
- View::DefinitionList
- Defined in:
- lib/view/formatters/definition_list.rb
Overview
Creates a simple definition list for an object. This works well with ActiveRecord objects. Without a block it will render all fields. You can specify the fields using the `fields` option.
You can use a block, to further format the way the definition items are formatted.
Defined Under Namespace
Classes: Attribute
Instance Attribute Summary
Attributes inherited from Formatter
Instance Method Summary (collapse)
-
- (Object) view(attribute, options = {}) {|formatter| ... }
This will add the dt and dd tags.
Methods inherited from Formatter
#all_options, as, inherited, #options, skip_blank_formatter, #to_s, type
Instance Method Details
- (Object) view(attribute, options = {}) {|formatter| ... }
This will add the dt and dd tags.
33 34 35 36 |
# File 'lib/view/formatters/definition_list.rb', line 33 def view(attribute, = {}, &block) tag = Attribute.new(value, attribute, block, template, ) tag.dt + tag.dd end |