Re: passing parameters between controllers

Shai Rosenfeld
2007-10-21T15:52:48Z

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 via http://www.ruby-forum.com/.