Class: Helpers::Forms::ButtonTo

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

Overview

ButtonToDelete.new(post_path(@post), confirm: “Are you sure?”)

Direct Known Subclasses

ButtonToDelete

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, attrs = Hash.new, &block) ⇒ ButtonTo

Returns a new instance of ButtonTo.



28
29
30
31
# File 'lib/helpers/forms.rb', line 28

def initialize(title, action, attrs = Hash.new, &block)
  button = Tag.new(:button, title, attrs.merge(type: "submit"))
  super(:form, button, action: action, &block)
end