Class: Effective::FormInputs::RemoteLinkTo

Inherits:
Submit show all
Defined in:
app/models/effective/form_inputs/remote_link_to.rb

Constant Summary

Constants inherited from Effective::FormInput

Effective::FormInput::BLANK, Effective::FormInput::DEFAULT_FEEDBACK_OPTIONS, Effective::FormInput::DEFAULT_INPUT_GROUP_OPTIONS, Effective::FormInput::EMPTY_HASH, Effective::FormInput::EXCLUSIVE_CLASS_PREFIXES, Effective::FormInput::EXCLUSIVE_CLASS_SUFFIXES, Effective::FormInput::HORIZONTAL_LABEL_OPTIONS, Effective::FormInput::HORIZONTAL_WRAPPER_OPTIONS, Effective::FormInput::INLINE_LABEL_OPTIONS, Effective::FormInput::VERTICAL_WRAPPER_OPTIONS

Instance Attribute Summary

Attributes inherited from Effective::FormInput

#name, #options

Instance Method Summary collapse

Methods inherited from Submit

#label_options, #to_html, #wrapper_options

Methods inherited from Effective::FormInput

#feedback_options, #hint_options, #initialize, #input_group_options, #input_js_options, #label_options, #to_html, #wrapper_options

Constructor Details

This class inherits a constructor from Effective::FormInput

Instance Method Details

#border?Boolean

Returns:

  • (Boolean)


22
23
24
# File 'app/models/effective/form_inputs/remote_link_to.rb', line 22

def border?
  false
end

#build_input(&block) ⇒ Object



7
8
9
10
11
12
13
14
15
16
# File 'app/models/effective/form_inputs/remote_link_to.rb', line 7

def build_input(&block)
  tags = [
    icon('check', style: 'display: none;'),
    icon('x', style: 'display: none;'),
    icon('spinner'),
    (block_given? ? capture(&block) : (:a, name, options[:input]))
  ]

  (left? ? tags.reverse.join : tags.join).html_safe
end

#confirmObject



26
27
28
# File 'app/models/effective/form_inputs/remote_link_to.rb', line 26

def confirm
  (options.delete(:confirm) || "#{name} to<br>#{object}?").html_safe
end

#input_html_optionsObject



18
19
20
# File 'app/models/effective/form_inputs/remote_link_to.rb', line 18

def input_html_options
  { class: '', rel: 'nofollow', data: { method: :post, remote: true, confirm: confirm } }
end