Sha256: e17be96465034ad0a4530a2692d6d3ccf070a97fa7fa91cc6f5e75f5d542bde1

Contents?: true

Size: 408 Bytes

Versions: 6

Compression:

Stored size: 408 Bytes

Contents

# frozen_string_literal: true

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

module DeleteLinkHelper
  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
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
defra_ruby_features-0.2.0 app/helpers/delete_link_helper.rb
defra_ruby_features-0.1.4 app/helpers/delete_link_helper.rb
defra_ruby_features-0.1.3 app/helpers/delete_link_helper.rb
defra_ruby_features-0.1.2 app/helpers/delete_link_helper.rb
defra_ruby_features-0.1.1 app/helpers/delete_link_helper.rb
defra_ruby_features-0.1.0 app/helpers/delete_link_helper.rb