From e2acf7a7107674abe90c2cb775eaa5f85d93d45e Mon Sep 17 00:00:00 2001 From: Bryan Larsen Date: Thu, 30 Aug 2012 22:51:51 -0400 Subject: [PATCH] "fix" remote-method-button by deprecating it and documenting its brokenness. --- .../buttons/remote_method_button.dryml | 22 +++++++++---------- 1 file changed, 10 insertions(+), 12 deletions(-) diff --git a/hobo_rapid/taglibs/buttons/remote_method_button.dryml b/hobo_rapid/taglibs/buttons/remote_method_button.dryml index cdcb99ccc..4c79bbf92 100644 --- a/hobo_rapid/taglibs/buttons/remote_method_button.dryml +++ b/hobo_rapid/taglibs/buttons/remote_method_button.dryml @@ -1,21 +1,21 @@ - -<%= +<%= ajax_attributes, html_attributes = attributes.partition_hash(HoboRapidHelper::AJAX_ATTRS) url ||= object_url(this, method.to_s.gsub('-', '_'), :method => :post) @@ -23,11 +23,9 @@ Forms). If any ajax attributes are given, the button becomes an ajax button, if add_classes!(html_attributes, "button remote-method-button #{method}-button") label ||= method.titleize - if update || !ajax_attributes.empty? + if !ajax_attributes.empty? ajax_attributes[:message] ||= label - func = ajax_updater(url, update, ajax_attributes.merge(:confirm => confirm)) - html_attributes.update(:onclick => "var e = this; " + func, :type =>'button', :value => label) - element(:input, html_attributes, nil, true, true) + fail "UNSUPPORTED" else button_to(label, url, html_attributes.merge(:confirm => confirm)) end