I wanted some code that would automatically reload the posts and insert them into the div post\_container:

```
<%= link_to_remote "Update", {:action => 'ajax_update', :id => @posts, :update => 'post_container'}, :confirm => "Are you sure?" %>

```

This rails snippet in my home.html.erb actually takes the entire page (title, head, body tags) and places it inside of the div post\_container. Why? Also, as far as I can tell, the ajax\_update function doesn't even get called.

How would I do what I am trying to do? And why is this entire page loading happening? I'm using Rails 2.3.11

(edit: also, there is no confirm dialog when you click the link.)

EDIT 2:
the html output of the code snippet:

```
<a confirm="Are you sure?" href="#" onclick="new Ajax.Updater('post_container', '/home', {asynchronous:true, evalScripts:true, parameters:'authenticity_token=' + encodeURIComponent('uaqM0Ie8to5pprvE6WcF416DN0vNeyO7Xa+JM6VZFY4=')}); return false;">Update</a>

```