Class: BlockSelectorInput

Inherits:
SimpleForm::Inputs::CollectionSelectInput
  • Object
show all
Defined in:
app/inputs/block_selector_input.rb

Instance Method Summary collapse

Instance Method Details

#collectionObject



13
14
15
# File 'app/inputs/block_selector_input.rb', line 13

def collection
  []
end

#input(wrapper_options) ⇒ Object



2
3
4
5
6
7
8
9
10
11
# File 'app/inputs/block_selector_input.rb', line 2

def input(wrapper_options)
  input_options[:hint] ||= 'Select a block from blocks on this page. You\'ll need to save the page after adding new blocks for them to appear in this list.'

  if object.try(:anchor).present?
    input_html_options[:data] ||= {}
    input_html_options[:data]['selected'] = object.anchor
  end

  super
end