Hi, I have 2 controllers A and B. The create method in controller A is programmed to redirect to B#index method. I want to pass data between my controllers, so i have made use of the params hash. But i cannot access the params hash on the index method of B controller. what is the right way to pass values between controllers? -- Posted via http://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-US.
i think you can pass data as the get parameters along with the request i.e generate the url which contains the parameters that you want to pass On Thu, Jun 28, 2012 at 4:02 AM, cyber c. <lists-fsXkhYbjdPsEEoCn2XhGlw@public.gmane.org> wrote:> Hi, > > I have 2 controllers A and B. The create method in controller A is > programmed to redirect to B#index method. I want to pass data between my > controllers, so i have made use of the params hash. But i cannot access > the params hash on the index method of B controller. what is the right > way to pass values between controllers? > > -- > Posted via http://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-US. > >-- Thanks, Aash -- 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-US.
You can pass parameter as redirect_to :controller=>''tips'', :action => ''show'', :id => "1" or redirect_to params[:search].merge! (:action => ''list'') On Thursday, 28 June 2012 04:02:33 UTC+5:30, Ruby-Forum.com User wrote:> > Hi, > > I have 2 controllers A and B. The create method in controller A is > programmed to redirect to B#index method. I want to pass data between my > controllers, so i have made use of the params hash. But i cannot access > the params hash on the index method of B controller. what is the right > way to pass values between controllers? > > -- > Posted via http://www.ruby-forum.com/. >-- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To view this discussion on the web visit https://groups.google.com/d/msg/rubyonrails-talk/-/FmkPJc4GOzsJ. 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-US.