How to find the id of a record you have just created in ruby on rails?

Posted by paul Thu, 21 Jul 2005 17:00:53 GMT

How do you get the id of a record you have just created in Ruby on Rails?

Well, the answer to this question came up on the rails mail list recently.

It goes something a little bit like this:

@text.save //insert something into the database @text.id //get the id of the new record
Comments

Leave a response

Comments