[Rails] redirect_to problem

Hi everyone!

  I have a problem with my redirect_to usage. Following code in my controller,
doesn't redirects to a page, but instead gives me '200 OK' HTTP response,
with information that document was moved, and link to a page where I
redirected user to.

  def destroy
    user = User.find(@params["id"])
    flash['notice'] = "User '#{user.name}' deleted"
    user.destroy
    redirect_to :action => "list"
  end

  This was taken almost exactly from the tutorial and it was workin' for me
nicely for a few days until I messed up something, I don't know what.
There's a set of after_filters that I use to implement nested layouts, maybe
problem is there. I'd appreciate if someone will tell me what that behavior
means, so I'll be able to investigate further. Of course I could check the
sources to see it by myself, but I'm not feeling *that* comfortable with
Rails yet :slight_smile:

Thanks in advance,

···

--
sdmitry -=- Dmitry V. Sabanin
MuraveyLabs.
Spam Here -> postmaster@sco.com

This was taken almost exactly from the tutorial and it was workin' for me
nicely for a few days until I messed up something, I don't know what.
There's a set of after_filters that I use to implement nested layouts, maybe
problem is there. I'd appreciate if someone will tell me what that behavior
means, so I'll be able to investigate further. Of course I could check the
sources to see it by myself, but I'm not feeling *that* comfortable with
Rails yet :slight_smile:

It does indeed seem like you have a problem with the after filters. Try turning them off and see if it works then. If so, I'll be happy to take a look at your after_filters to help you figure out what the problem is there.

If you want real time help, I can recommend trying out #rubyonrails on FreeNet.

···

--
David Heinemeier Hansson,
http://www.rubyonrails.org/ -- Web-application framework for Ruby
http://www.instiki.org/ -- A No-Step-Three Wiki in Ruby
http://www.basecamphq.com/ -- Web-based Project Management
http://www.loudthinking.com/ -- Broadcasting Brain
http://www.nextangle.com/ -- Development & Consulting Services

Yep, it was problem with my after filters, I fixed it with following code:

  def layout_normal
    @content_for_layout = response.body
    saved_headers = response.headers.dup # this
    render 'layouts/main'
    response.headers = saved_headers # and this
    true
  end

Btw, big thank you and others for Rails!

···

On Monday 04 October 2004 14:59, David Heinemeier Hansson wrote:

It does indeed seem like you have a problem with the after filters. Try
turning them off and see if it works then. If so, I'll be happy to take
a look at your after_filters to help you figure out what the problem is
there.

--
sdmitry -=- Dmitry V. Sabanin
MuraveyLabs.
Spam Here -> postmaster@sco.com