link_to_remote in rails, problem pass :id

Posted by nakada on Stack Overflow See other posts from Stack Overflow or by nakada
Published on 2010-04-04T16:06:37Z Indexed on 2010/04/04 16:13 UTC
Read the original article Hit count: 263

i have problem use link_to_remote

link_to_remote document example say

link_to_remote "Delete this post", :update => "posts", :url => { :action => "destroy", :id => post.id }

this code make below html code

<a href="#" onclick="new Ajax.Updater('posts', '/blog/destroy/3', {asynchronous:true, evalScripts:true}); return false;">Delete this post</a>

but my app don't. my html is

<a href="#" onclick="new Ajax.Updater('posts', '/blog/6', {asynchronous:true, evalScripts:true, parameters:'authenticity_token=' + encodeURIComponent('2C4Yo8OIDN+dm9oieL37uRg++PuWa8LCz18gW5Cu+Vg=')}); return false;">Delete this post</a>

where is destroy in url?

i expected '/blog/destroy/6' but actually 'blog/6'

what's the problem?

my rails version is 2.3.5

© Stack Overflow or respective owner

Related posts about ruby-on-rails

Related posts about link-to-remote