class ActionView::Helpers::FormBuilder
def button(value = nil, options = {}, &block)
#
# Save as draft
# =>
# Create post
# =>
# Ask me!
# =>
def button(value = nil, options = {}, &block) case value when Hash value, options = nil, value when Symbol value, options = nil, { name: field_name(value), id: field_id(value) }.merge!(options.to_h) end value ||= submit_default_value if block_given? value = @template.capture { yield(value) } end formmethod = options[:formmethod] if formmethod.present? && !/post|get/i.match?(formmethod) && !options.key?(:name) && !options.key?(:value) options.merge! formmethod: :post, name: "_method", value: formmethod end @template.button_tag(value, options) end