Hi all
There is a scenario with 2 tables.
I will insert the one row in table 1 and after I save my row in table
one I
want that Id to be saved in another table immediately how to approach
this
scenario.
kindly help me
Regards,
Honey
Hi all
There is a scenario with 2 tables.
I will insert the one row in table 1 and after I save my row in table
one I
want that Id to be saved in another table immediately how to approach
this
scenario.
kindly help me
Regards,
Honey
On 30 August 2013 09:00, honey ruby [email protected] wrote:
Hi all
There is a scenario with 2 tables.
I will insert the one row in table 1 and after I save my row in table one I
want that Id to be saved in another table immediately how to approach this
scenario.
Which bit don’t you know how to do?
Where to put the code?
How to determine the id of the row?
How to find the record in the second table?
How to change the value in the second table?
How to save the value in the second table?
Something else?
But before that the more important question is whether you should have
a belongs_to, has_many (or similar) association between the tables so
that rails will do most of the work for you.
Colin
This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.
Sponsor our Newsletter | Privacy Policy | Terms of Service | Remote Ruby Jobs