Topic: Rails 3 ajax newsfeed

I created a Facebook-like newsfeed in Rails 3 with AJAX, in webkit browsers its works fine (Chrome, Safari), but in the new Firefox 4, after I post a comment, the page doesn't refresh. What's wrong? 

he controller:

  def new
    @messages=Post.order("created_at DESC")
    @post = Post.new
    respond_to do |format|
      format.html { render :action => "new" }
      format.js
    end
  end

  def create
    @post = Post.create(params[:post])
    respond_to do |format|
      if @post.save

        format.js    {
          redirect_to new_post_path
          @messages=Post.order("created_at DESC")
        }
      else
        format.html { render :action => "new" }
        format.js
      end
    end
end

and create.js.erb:

$('.content').html("<%= escape_javascript(render(:partial => "posts/new")) %>");

Last edited by Dodi (2011-04-03 16:12:42)