# Page rendering inside div

**URL:** <https://www.ruby-forum.com/t/page-rendering-inside-div/115130>\
**Category:** Rails\
**Created:** [September 20, 2007, 10:29pm UTC](https://www.ruby-forum.com/t/page-rendering-inside-div/115130 "2007-09-20T22:29:45Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Glen](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/g/8c91f0/32.png) [@Glen](https://www.ruby-forum.com/u/Glen)\
**Post date:** [September 20, 2007, 10:29pm UTC](https://www.ruby-forum.com/t/page-rendering-inside-div/115130/1 "2007-09-20T22:29:45Z")

</div>

For a reason I can’t figure out, no matter what I try. I have a page  
that refreshes inside a div on that page, recursively forever. At  
this point I’m sure it’s something super obvious since I have tried  
everything and nothing changes it.

Here is the code:

def create  
@post = Post.new(params[:post])  
@post.user\_id = session[:user].id  
@post.conversation\_id = params[:conversation\_id]

```
@conversation = Conversation.find(params[:conversation_id])

replies = @conversation.replies + 1

@posts = Post.find(:all, :conditions => ["conversation_id = ?",

```

params[:conversation\_id]])

```
if @post.save
  Conversation.update(params[:conversation_id], { :updated_at =>

```

Time.now, :replies =\> replies })  
User.update(session[:user].id, { :num\_posts =\>  
(session[:user].num\_posts += 1) })  
redirect\_to :controller =\> ‘conversations’, :action =\>  
‘show’, :id =\> params[:conversation\_id]  
else  
render :action =\> ‘new’  
end  
end

That method is called by an ajax form. For some reason the  
redirect\_to renders inside a div on the same page. It’s rendering the  
whole page but no cleanly. I have no idea what it causing it.

Shouldn’t redirect\_to always render the entire page from scratch?

---

<div class="post-metadata">

**Author:** ![Glen](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/g/8c91f0/32.png) [@Glen](https://www.ruby-forum.com/u/Glen)\
**Post date:** [September 20, 2007, 10:36pm UTC](https://www.ruby-forum.com/t/page-rendering-inside-div/115130/2 "2007-09-20T22:36:47Z")

</div>

Sorry guys, entirely my bad. After looking at it out of context I  
figured it out, as often happens.
