Class: DefinitionComponentPreview

Inherits:
ViewComponent::Preview
  • Object
show all
Defined in:
lib/alveole/previews/definition_component_preview.rb

Defined Under Namespace

Classes: TempObj

Instance Method Summary collapse

Instance Method Details

#defaultObject



14
15
16
17
# File 'lib/alveole/previews/definition_component_preview.rb', line 14

def default
  temp_obj = TempObj.new
  render(DefinitionComponent.new(label: nil, value: nil, obj: temp_obj, fieldname: :fieldname, options: {}))
end

#with_labelObject



19
20
21
22
# File 'lib/alveole/previews/definition_component_preview.rb', line 19

def with_label
  temp_obj = TempObj.new
  render(DefinitionComponent.new(label: 'custom label', value: nil, obj: temp_obj, fieldname: :fieldname, options: {}))
end

#with_optionsObject



29
30
31
32
# File 'lib/alveole/previews/definition_component_preview.rb', line 29

def with_options
  temp_obj = TempObj.new
  render(DefinitionComponent.new(label: nil, value: nil, obj: temp_obj, fieldname: :fieldname, options: { style: 'color:red' }))
end

#with_valueObject



24
25
26
27
# File 'lib/alveole/previews/definition_component_preview.rb', line 24

def with_value
  temp_obj = TempObj.new
  render(DefinitionComponent.new(label: nil, value: 'custom value', obj: temp_obj, fieldname: :fieldname, options: {}))
end