lib/jqr-helpers/helpers.rb in jqr-helpers-1.0.17 vs lib/jqr-helpers/helpers.rb in jqr-helpers-1.0.18

- old
+ new

@@ -109,11 +109,11 @@ # button_to, so note that a form element will be added. # @param html_content [String] the text or content to go inside the button # @param url [String] the URL which the button should go to if confirmed # @param message [String] the confirm message to prompt # @param html_options [Hash] HTML attributes. - def confirm_button(html_content, url, message, html_options) + def confirm_button(html_content, url, message, html_options={}) button_to html_content, url, html_options.merge( :'data-message' => simple_format(message), # turn text into HTML :'data-ujs-confirm' => true ) end @@ -365,9 +365,10 @@ new_options[:class] << ' ujs-ajax' new_options[:'data-type'] = 'html' new_options[:'data-callback'] = options.delete(:callback) new_options[:'data-close-dialog'] = options.delete(:close_dialog) new_options[:'data-use-dialog-opener'] = options.delete(:use_dialog_opener) + new_options[:'data-refresh'] = true if options.delete(:refresh) [:update, :append, :delete].each do |result_method| selector = options.delete(result_method) if selector new_options[:'data-selector'] = selector