Module: DeleteLinkHelper

Defined in:
app/helpers/delete_link_helper.rb

Overview

Credits: viget.com/articles/delete-in-rails-without-jquery-and-ujs/

Instance Method Summary collapse

Instance Method Details

#delete_button_to(title, url, options = {}) ⇒ Object



6
7
8
9
10
11
12
13
14
15
# File 'app/helpers/delete_link_helper.rb', line 6

def delete_button_to(title, url, options = {})
  html_options = {
    class: "delete_button_to",
    method: "delete"
  }.merge(options.delete(:html_options) || {})

  form_for :delete, url: url, html: html_options do |f|
    f.submit title, options
  end
end