search for: generate_unique_token

Displaying 1 result from an estimated 1 matches for "generate_unique_token".

2012 Oct 17
1
generate 10 UUID records and save it it database in rails
I need to create certain number of UUId records(based on the selection of drop down) and save it in the database. Now I am generating only one unique id. Can this be done in the model in this way. Or do I need to write a helper file for that?? def generate_unique_token=(value) self.secret = Base64.encode64(UUIDTools::UUID.random_create)[0..8] end In my controller........... def create @secretcode= Secretcode.new(params[:secretcode]) @user= User.new(params[:user]) @secretcode.user_id=@user @secretcode.generate_unique_token=params[:secretcode][...