hello frnds I want to first connect to one table then fetch the desired value...store that in variable and then copy the contents of that variable to another table. Can you tell me how to do that? Thanks Dhaval Parikh -- 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 -~----------~----~----~----~------~----~------~--~---
ok let me understand it dhval has table_1 and table_2 hes saving some fields in table_1 which is in the instance_variable(object) called abc now he wants to save the contents of object abc in table_2 ok in this case we can use after_save which saves the passed parameters in the mentioned table from table 1 i hope it works do mail me back if it doenst have fun On 9/5/07, Dhaval Parikh <rails-mailing-list-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org> wrote:> > > hello frnds > > I want to first connect to one table then fetch the desired > value...store that in variable and then copy the contents of that > variable to another table. Can you tell me how to do that? > > Thanks > > Dhaval Parikh > -- > Posted via http://www.ruby-forum.com/. > > > >-- Piyush 09916133729 <Bangalore> http://ctrlshiftesc.blogspot.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 -~----------~----~----~----~------~----~------~--~---
Yes what you have understood is perfect but then can you give me an example with coding then that will be gr8 as i havent used after_save method b4.. Thanks Dhaval Parikh -- 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 -~----------~----~----~----~------~----~------~--~---
have A loook at http://api.rubyonrails.org/ sarch for after_save then u can pass the parametrs which you want to somewhat like Table2.create(:table1_id => table1_id, :id => table1.id, ) i hope it works u may use after_create check the api link and figure out which suits u the best see ya have fun On 9/5/07, Dhaval Parikh <rails-mailing-list-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org> wrote:> > > Yes what you have understood is perfect but then can you give me an > example with coding then that will be gr8 as i havent used after_save > method b4.. > > Thanks > > Dhaval Parikh > -- > Posted via http://www.ruby-forum.com/. > > > >-- Piyush 09916133729 <Bangalore> http://ctrlshiftesc.blogspot.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 -~----------~----~----~----~------~----~------~--~---
Thanks again this is much clearer but the thing is that i dont want to create table dynamically.I just want to copy the contents to a table that is already created say suppose i have one value in @email which stores the email address then i want to copy that value to the email field in table2 the structure of which is already created..hope this is clear thanks Dhaval Parikh -- 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 -~----------~----~----~----~------~----~------~--~---