# \[Ajax\] draggable\_element with button inside

**URL:** <https://www.ruby-forum.com/t/ajax-draggable-element-with-button-inside/51696>\
**Category:** Rails\
**Created:** [January 6, 2006, 12:43am UTC](https://www.ruby-forum.com/t/ajax-draggable-element-with-button-inside/51696 "2006-01-06T00:43:02Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Didier](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/41988e/32.png) [@Didier](https://www.ruby-forum.com/u/Didier)\
**Post date:** [January 6, 2006, 12:43am UTC](https://www.ruby-forum.com/t/ajax-draggable-element-with-button-inside/51696/1 "2006-01-06T00:43:02Z")

</div>

Hi guys,

I have the following code:

- \<%= active\_task.title %\>&nbsp;\<%= link\_to\_remote "Edit", :update =\> "active\_task\_#{active\_task.id}", :url =\> { :action =\> "edit", :id =\> active\_task.id } %\>

The goal is when a user clicks on the “Edit” button, a new html portion  
appears  
with a html form (in order to modify the name of the task). The previous  
code  
works. so far so good.  
But I added a new javascript feature:

\<%= draggable\_element “active\_task\_#{active\_task.id}”, :revert =\> true  
%\>

Now, the problem is that I don’t manage to distinct the click on the  
“edit”  
button and the one for “drag” action.  
How to solve this problem ? does a solution exist ?

Thanks  
Best regards.

Didier
