11155
(-- --)
November 27, 2013, 1:38pm
1
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
Rafi_A
(Rafi A)
November 27, 2013, 3:22pm
2
Have you tried the below way??
redirect_to pictures_path, :update_images=>@pictures.to_s
Colin_Law1
(Colin Law)
November 27, 2013, 3:47pm
3
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
11155
(-- --)
November 28, 2013, 1:52pm
4
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