The reason you were getting an incorrect parameter is that the method,
"session", returns a hash, not a string. So calling session returns
something like {:user => "2"}. When you pass a hash to the
redirect
method, it tries to turn it into a string using the "to_s" method on a
hash, which just jams the key/value pairs together in a string:
{:user => "2"}.to_s
# => "user2"
If I understand what you are trying to do, you should specify the user
key in your session in your controller''s redirect method:
:action => ''new'', :result => session[:user]
that will redirect the browser to the URL:
test_controller/new?result=2
Good luck,
Casey
On Jan 6, 2:34 am, Ahmet Kilic
<li...-fsXkhYbjdPsEEoCn2XhGlw@public.gmane.org>
wrote:> Hi everybody,
>
> I have paramaters like this
>
> this is action on controller side
> :action => ''new'', :result => session %>
> and this is view side
> test_controller/new?&&&&&result[user]=2
>
> user controller
> @user = User.find(params[:result])
> I coudn`t get the value with params
> it gives me user2 result. but I want only 2
>
> how can I come through this problem?
> please help
> --
> Posted viahttp://www.ruby-forum.com/.
--
You received this message because you are subscribed to the Google Groups
"Ruby on Rails: Talk" group.
To post to this group, send email to
rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
To unsubscribe from this group, send email to
rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en.