Displaying 1 result from an estimated 1 matches for "brainfreeze".
2006 Jul 10
2
Simple question about retrieving id''s
...ting a
new record in a table like so:
def create
@myInstance = MyModel.new(params[:formVars])
@myInstance.save!
end
My question is: How do I then get the id of the newly created record
within this create method? It seems like it should be pretty
straightforward, but I''m having a brainfreeze about it, and I didn''t see
a method in the rails api that did that.
Thanks in advance for any tips.
--
Posted via http://www.ruby-forum.com/.