Sorry guys, entirely my bad. After looking at it out of context I
figured it out, as often happens.
On Sep 20, 2:28 pm, Glen
<DamnBig...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
wrote:> 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?
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Ruby on Rails: Talk" group.
To post to this group, send email to
rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
To unsubscribe from this group, send email to
rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---