Hello, Can anyone assist me with the following? I have a hash (@pictures) with quite a bit of data I want to pass with a redirect_to. @pictures = [] @minisections.each do |minisection| @pictures << minisection.pictures end @pictures.flatten! redirect_to pictures_path(:update_images => @pictures) The above redirect does not work. I have also tried several other options. My other option is to move the @pictures code to the action I am redirecting to. Any guidance would be appreciated. Dave -- 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 unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/e84f340d6a549b5b5eb7ebc29e3489c3%40ruby-forum.com. For more options, visit https://groups.google.com/groups/opt_out.
Have you tried the below way?? redirect_to pictures_path, :update_images=>@pictures.to_s On Nov 27, 2013 7:08 PM, "Dave Castellano" <lists-fsXkhYbjdPsEEoCn2XhGlw@public.gmane.org> wrote:> Hello, > > Can anyone assist me with the following? > > I have a hash (@pictures) with quite a bit of data I want to pass with a > redirect_to. > > @pictures = [] > @minisections.each do |minisection| > @pictures << minisection.pictures > end > @pictures.flatten! > > redirect_to pictures_path(:update_images => @pictures) > > The above redirect does not work. I have also tried several other > options. > > My other option is to move the @pictures code to the action I am > redirecting to. > Any guidance would be appreciated. > > Dave > > -- > 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 unsubscribe from this group and stop receiving emails from it, send an > email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org > To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org > To view this discussion on the web visit > https://groups.google.com/d/msgid/rubyonrails-talk/e84f340d6a549b5b5eb7ebc29e3489c3%40ruby-forum.com > . > For more options, visit https://groups.google.com/groups/opt_out. >-- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/CA%2BfXU%2B2JOcHTfb%2BEhpP191Wj0CbMWo8_VqH4WTL00PBfYeOjag%40mail.gmail.com. For more options, visit https://groups.google.com/groups/opt_out.
On 27 November 2013 13:38, Dave Castellano <lists-fsXkhYbjdPsEEoCn2XhGlw@public.gmane.org> wrote:> Hello, > > Can anyone assist me with the following? > > I have a hash (@pictures) with quite a bit of data I want to pass with a > redirect_to. > > @pictures = [] > @minisections.each do |minisection| > @pictures << minisection.pictures > end > @pictures.flatten! > > redirect_to pictures_path(:update_images => @pictures) > > The above redirect does not work. I have also tried several other > options. > > My other option is to move the @pictures code to the action I am > redirecting to. > Any guidance would be appreciated.Since you have not said what does not work it is difficult to help. As a general rule always pass the minimum amount of data in the url. So if possible just pass whatever information is required to identify the data and do the lookup in the controller action. Colin -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/CAL%3D0gLtxNWfkFtJ0nRJvC-q2V-bkQeuBsV%3DZ9ihF5cS%2BS4nxTw%40mail.gmail.com. For more options, visit https://groups.google.com/groups/opt_out.
Colin Law wrote in post #1128815:> So if possible just pass whatever information is required to identify > the data and do the lookup in the controller action.Sounds like the better option is to move the code to the action I am redirecting to. Will try it. Thanks Dave -- 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 unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/2ce9fb20c49aea8e3d3210b5efb7d883%40ruby-forum.com. For more options, visit https://groups.google.com/groups/opt_out.