Class: ChipsInputPreview

Inherits:
Lookbook::Preview
  • Object
show all
Defined in:
lib/lookbook/chips_input_preview.rb

Instance Method Summary collapse

Instance Method Details

#default(label: 'Chips Input', disabled: false, required: false) ⇒ Object

Parameters:

  • label (defaults to: 'Chips Input')

    text

  • disabled (defaults to: false)

    toggle

  • required (defaults to: false)

    toggle



8
9
10
11
12
# File 'lib/lookbook/chips_input_preview.rb', line 8

def default(label: 'Chips Input', disabled: false, required: false)
  render 'common/form', helper_name: 'material_chips_input',
                                 url: '/countries', name: 'countries', label:, id: 'Input', disabled:, required:,
                                 options: Carmen::Country.all.map { |c| { id: c.alpha_3_code, label: c.name } }
end