Module: Cocooned::Helpers::Tags::Down

Defined in:
lib/cocooned/helpers/tags/down.rb

Overview

Helpers to generate action triggers to move items down in a nested form.

Signatures

{method}(label, form, options = {})
  # Explicit name

{method}(form, options = {}) do
  # Name as a block
end

{method}(form, options = {})
  # Use default name

Parameters

‘label` is the text to be used as the link label. See the main documentation for Cocooned::Helpers::Tags for more about labelling.

‘form` is your form builder. Can be a SimpleForm::Builder, Formtastic::Builder or a standard Rails FormBuilder.

Instance Method Summary collapse

Instance Method Details

#cocooned_move_item_down_button(*args, &block) ⇒ Object

Output a button to move an item down.

Signatures

cocooned_move_item_down_button(label, form, options = {})
  # Explicit name

cocooned_move_item_down_button(form, options = {}) do
  # Name as a block
end

cocooned_move_item_down_button(form, options = {})
  # Use default name

See Cocooned::Helpers::Tags::Add main documentation for a reference of supported parameters.

See the documentation of ActionView::Helpers::FormBuilder#button for valid options.



70
71
72
# File 'lib/cocooned/helpers/tags/down.rb', line 70

def cocooned_move_item_down_button(*args, &block)
  cocooned_button(Cocooned::Tags::Down, *args, &block)
end

Output a link to move an item down.

Signatures

cocooned_move_item_down_link(label, form, options = {})
  # Explicit name

cocooned_move_item_down_link(form, options = {}) do
  # Name as a block
end

cocooned_move_item_down_link(form, options = {})
  # Use default name

See Cocooned::Helpers::Tags::Down main documentation for a reference of supported parameters.

See the documentation of ActionView::Base#link_to for additional options.



47
48
49
# File 'lib/cocooned/helpers/tags/down.rb', line 47

def cocooned_move_item_down_link(*args, &block)
  cocooned_link(Cocooned::Tags::Down, *args, &block)
end