Hello all! Situation: user has a possibility to create variable amount number of objects. The number choses user himself. After creating user wants to see all just created objects. And only them. Not the rest. How can it be done? I put all created object in an array but what then? Redirecting to the "index" shows all the objects in the table and my variable @created_objects is after redirection no longer available. Thanx for help! -- 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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
You could store the ids in an array in the session. Note: Don''t store the entire objects in the session just the id columns so you can look them back up in after the redirect. Medwedj Potapow wrote:> Hello all! > > Situation: user has a possibility to create variable amount number of > objects. The number choses user himself. After creating user wants to > see all just created objects. And only them. Not the rest. > How can it be done? > > I put all created object in an array but what then? Redirecting to the > "index" shows all the objects in the table and my variable > @created_objects is after redirection no longer available. > > Thanx for help!-- 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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
I solved the problem myself! The point is: while creating Istored all the object in an array. After saving I did: respond_to do |format| format.html { render :action => ''last_created'' } end An in the view "last_created" I go over the entire array and show all the objects in a table. -- 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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---