Class: Helpers::Forms::ButtonToDelete
- Inherits:
-
ButtonTo
- Object
- SelfCloseTag
- Tag
- ButtonTo
- Helpers::Forms::ButtonToDelete
- Defined in:
- lib/helpers/forms.rb
Instance Attribute Summary
Attributes inherited from Tag
Attributes inherited from SelfCloseTag
Instance Method Summary collapse
-
#initialize(title, action = nil, attrs = Hash.new) ⇒ ButtonToDelete
constructor
A new instance of ButtonToDelete.
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 |