Redirecting to another controller, with a POST method

first of all: i don't know if using POST with a redirect is possible.

but other than that: i don't think you really need that.

on the one hand you could just leave that   if request.post? out and everything is fine. i don't think you really need to check for POST in logout. the user is not submitting any data.

on the other hand (if you want to stick to that POST thing) you could add something like this:   if request.post? or params[:redirect]

now in your redirection just add   , :params => {:redirect => true}

that should do the trick

i think the difference is that form a view there can be a real POST (with user submitting data, pressing a button, ...), but a controller just GETs infos and stuff. i'm no expert, so that is just a guess.

normally you POST things that create or destroy things. in other words actions that make a difference. "logout" is somewhere in between. it doesn't really do anything harmful or constructive, but it changes the state of your user. so in my opinion, logout could as well be a POST as a GET method. in my last project i didn't check for POST in my logout-action. btw: authlogic doesn't do that either in their example.

Fernando Perez wrote:

Hi,

You cannot redirect with a POST method, so you'll have to find a trick to circumvent that issue.

Right!

Cheers, Vahagn