# Link\_to\_remote problem

**URL:** <https://www.ruby-forum.com/t/link-to-remote-problem/145060>\
**Category:** Rails\
**Created:** [August 5, 2008, 5:51pm UTC](https://www.ruby-forum.com/t/link-to-remote-problem/145060 "2008-08-05T17:51:24Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![jturney](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/e99b99/32.png) [@jturney](https://www.ruby-forum.com/u/jturney)\
**Post date:** [August 5, 2008, 5:51pm UTC](https://www.ruby-forum.com/t/link-to-remote-problem/145060/1 "2008-08-05T17:51:24Z")

</div>

view:  
\<%= link\_to\_remote “#{post.title}”, :url =\> { :controller=\>:threads,  
:action=\>:show\_content, :id=\>post.id} %\>

controller:  
def show\_content  
@post = Post.find\_by\_id params[:id]  
respond\_to do |format|  
format.html { redirect\_to\_index}  
format.js  
end  
end

rjs:  
page.replace\_html “#{@post.id}\_content”, " dsf", :object =\> @post

When I click on the link\_to\_remote, I get RJS error [Object error]. The  
link I click is id “364\_content”, and the error is  
“Element.update(‘364\_content’, ‘dsf’)”

What’s the problem? =|

Thanks!!

---

<div class="post-metadata">

**Author:** ![jturney](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/e99b99/32.png) [@jturney](https://www.ruby-forum.com/u/jturney)\
**Post date:** [August 5, 2008, 5:52pm UTC](https://www.ruby-forum.com/t/link-to-remote-problem/145060/2 "2008-08-05T17:52:22Z")

</div>

Oh yah, and here’s what I’m trying to update:  
for post in @posts…  
…

 in the view. ...

---

<div class="post-metadata">

**Author:** ![jturney](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/e99b99/32.png) [@jturney](https://www.ruby-forum.com/u/jturney)\
**Post date:** [August 5, 2008, 5:55pm UTC](https://www.ruby-forum.com/t/link-to-remote-problem/145060/3 "2008-08-05T17:55:47Z")

</div>

This is what firebug says: $(element) is null  
[Break on this error] return $(element).style.display != ‘none’;
