Re: passing parameters between controllers

Shishir Srivastava
2007-10-21T18:59:01Z

Thanks Shai !! It worked :)

~shishir

On Oct 21, 8:52 pm, Shai Rosenfeld
<rails-mailing-l...-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org>
wrote:
>  controllerA
> ============>  def method1
>  id =(params[''user_name''])
>  redirect_to({:controller => "controllerB", :action =>
>  "method2", :user=>id } )  # put the :user INSIDE the path
hash.
>  end
>
>  controllerB
> ============>  def method2 user # DONT NEED THIS
>  def method2 # without the user parameter
>  @user=params[''user''] #--> the parameter is passed
automatically via the
> params hash; no need to define the parameter in the def clause.
>  end
>
> enjoy
> --
> Posted viahttp://www.ruby-forum.com/.