kingduggan wrote: > Hello All, > > So I am new to rails and the first project I am creating is a > ticketing system to log customer support. All I am trying to do is > have the primary id of each new ticket auto increment like ticket id > 1001, 1002, 1003, ect. and display the ticket id in the show tickets. > > I am confused because I'm not sure if this would be created doing a > migration or in the model tickets after the migration has been done?? > > Any help would be great.
Unless I'm not understanding the question, you already have this. With ActiveRecord, (by default) every record has an id that will be unique. You don't have to do anything to get it. While you can override it, every table has a field named 'id'. This will be incremented and maintained by the system. In MySQL it will be an 'auto_increment' field and defined as the primary key. ---Michael -- 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 [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---

