Hobo/hobo — pull request #18 by iox (2012-12-22 10:52:28+00:00)
Title: Using Ajax with transition-buttons in Hobo 2.0 pre7

When using Ajax, the transition-button does not work. Example:

```xml

Without Ajax (it works)

With Ajax (it does not work)

```

After some debugging I found out that the server is detecting the call as GET, instead of PUT. It looks like the HTML generated for Ajax requests is not setting the method correctly. I made a small workaround to the transition-button tag to force the method and action:

```diff
diff --git a/hobo_rapid/taglibs/buttons/transition_button.dryml b/hobo_rapid/taglibs/buttons/transition_button.dryml
index 6a7f3b3..df47c1a 100644
--- a/hobo_rapid/taglibs/buttons/transition_button.dryml
+++ b/hobo_rapid/taglibs/buttons/transition_button.dryml
@@ -50,9 +50,9 @@ If the transition could not be found, the user does not have permissions for the

if (!ajax_attributes.empty?) && !has_params
ajax_attributes[:message] ||= label
- ajax_attributes[:method] = html_attributes[:method]
- %>

+ %>

+

<%
else %><%=

```
I suspect I might be breaking some other use cases. What do you think?