Problems with redirect

Hi,

In my home page, the user can search for an item and if he likes he can
add
it to his favorites.

If the user is logged in already then this works fine.

But if the user is not logged in then he is redirected to the “login”
page
and then redirected to the “create fav” action. But in this scenario
when I
redirect, the message is redirected as a “GET” rather than a “POST” and
my
action (create_fav) is redirected to list_action.

I have the original model and referrer in session and I can see them if
I
debug.

Any clue what is wrong?

Thanks, Hari

View this message in context:
http://www.nabble.com/Problems-with-redirect-tf1884220.html#a5150805
Sent from the RubyOnRails Users forum at Nabble.com.

Hi, I just found out the following line causes the issue:

After the user is logged in the user is redirected to “create” as “GET”
method instead of “POST”. So the controller checks the request and as
its
not “POST” redirects to list.

from log:
127.0.0.1 - - “POST /h/login HTTP/1.1” 302 104
http://localhost:3003/h/login → /h/login
127.0.0.1 - - “GET /fav/create HTTP/1.1” 500 11330

in my controller:
verify :method => :post, :only => [ :destroy, :create, :update ],
:redirect_to => { :action => :list }

So any idea how to make the redirect to make a “POST” instead of “GET”?

Thanks, Hari

View this message in context:
http://www.nabble.com/Problems-with-redirect-tf1884220.html#a5151641
Sent from the RubyOnRails Users forum at Nabble.com.