Class: Helpers::Forms::ButtonToDelete

Inherits:
ButtonTo show all
Defined in:
lib/helpers/forms.rb

Instance Attribute Summary

Attributes inherited from Tag

#content, #indentation

Attributes inherited from SelfCloseTag

#attrs, #name

Instance Method Summary collapse

Methods inherited from Tag

#each, #self_closing_tag, #tag, #to_s

Methods inherited from SelfCloseTag

#[], #[]=, #data, #inspect, #to_s

Constructor Details

#initialize(title, action = nil, attrs = Hash.new) ⇒ ButtonToDelete

Returns a new instance of ButtonToDelete.



35
36
37
38
# File 'lib/helpers/forms.rb', line 35

def initialize(title, action = nil, attrs = Hash.new)
  action, title = title, "Destroy" if title && action.nil?
  super(title, action + "?_method=DELETE", attrs.merge(name: name, value: value))
end