I have an ActiveRecord model (I’m on rails 2.3.8) called user and I’m saving it as
user = User.new
user.name = "user name"
user.save!
what I want to do is get the generated user id after creating the user. But currently it returns true/ false value upon saving
How can I get the saved user id?
Just call
user.idafter you’ve saved.