# No call funtion

**URL:** <https://www.ruby-forum.com/t/no-call-funtion/157987>\
**Category:** Rails\
**Created:** [January 17, 2009, 11:28am UTC](https://www.ruby-forum.com/t/no-call-funtion/157987 "2009-01-17T11:28:41Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![maite](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/e495f1/32.png) [@maite](https://www.ruby-forum.com/u/maite)\
**Post date:** [January 17, 2009, 11:28am UTC](https://www.ruby-forum.com/t/no-call-funtion/157987/1 "2009-01-17T11:28:41Z")

</div>

hello everybody I have this in my view

```
  <tr id= "id_<%= x.nombre%>">
    <td width="200"><%= x.nombre%></td>
    <td width="10"><%= link_to_remote image_tag("delete.png"),

```

:url=\>{:controller=\>“merca\_usuarios”,  
:action=\>“destroy”, :id=\>x}, :complete =\> “new  
Effect.Fade(‘id\_#{x.nombre}’)” %\>

when I click in delete image this line fade n the view but don’t delete  
this id of the database, so action destroy never call, why??? what  
happen???

i inpruve write :update=\> “contener” in link\_to\_remote but this return  
me an error  
unknown method 55 in this case when x= 55 params id of url

thanks for all

---

<div class="post-metadata">

**Author:** ![maite](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/e495f1/32.png) [@maite](https://www.ruby-forum.com/u/maite)\
**Post date:** [January 17, 2009, 8:54pm UTC](https://www.ruby-forum.com/t/no-call-funtion/157987/2 "2009-01-17T20:54:17Z")

</div>

Maite P. wrote:

> this id of the database, so action destroy never call, why??? what  
> happen???

Please post your controller’s action code, too, and your test cases.

And shouldn’t :id =\> x be :id =\> x.id ?

–  
Phlip

---

<div class="post-metadata">

**Author:** ![maite](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/e495f1/32.png) [@maite](https://www.ruby-forum.com/u/maite)\
**Post date:** [January 17, 2009, 11:44pm UTC](https://www.ruby-forum.com/t/no-call-funtion/157987/3 "2009-01-17T23:44:22Z")

</div>

On Jan 17, 7:53 pm, Phlip [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> > when I click in delete image this line fade n the view but don’t delete  
> > this id of the database, so action destroy never call, why??? what  
> > happen???
> 
> Please post your controller’s action code, too, and your test cases.
> 
> And shouldn’t :id =\> x be :id =\> x.id ?

that doesn’t matter. url\_for special cases :id and tries to call  
to\_param on what you give it if it’s an AR object, and the default  
definition of to\_param is just id.

Fred

---

<div class="post-metadata">

**Author:** ![maite](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/e495f1/32.png) [@maite](https://www.ruby-forum.com/u/maite)\
**Post date:** [January 18, 2009, 12:20pm UTC](https://www.ruby-forum.com/t/no-call-funtion/157987/4 "2009-01-18T12:20:57Z")

</div>

ok, the accion to controller is this

def destroy  
empre=params[:id]  
empre=empre.to\_i  
@todo=MercaUsuario.find(:all)  
@todo.each do |x|  
if (x.user\_id == current\_user.id)&&(x.empresa== empre)  
x.destroy  
end  
end  
end

but link\_to\_remote no call function if I push debugger in this funcion  
nothing happen

thaks again
