Redirect with parameters

Hi guys,

Quick problem that’s being annoying me for the last hour. Say I have
redirect_to(:controller => ‘account’, :action => ‘x’) then I’m
redirected to the page account/x fine. How would I get redirected to
account/x?a=b&c=d&e=f… ? I have an array of parameters or a string
of parameters, in either case I can’t find a way to redirect!

Cheers,

George

Hi. I think you can use redirect_to with :params like this example:

class SayController < ApplicationController
def hello
@time = Time.now
redirect_to :action => ‘goodbye’, :params => {“time” =>
@time}
end
def goodbye (*params)
raise request.inspect.to_s
end

if you look at “REQUEST_URL” =>
http://10.6.14.37:3000/say/goodby?time=Sat+Dec+16+03%3A59+2B0300+2006
you can pass more then one parameters {“time” => @time, “word” =>
“YES”, …}

Best Regards, Sergey

Sorry, parameter (*params) dont need, you can simple write
def goodby
raise params[:time]
end

and you will see the time.

Best Regards, Sergey