I think you’re looking for custom fields on the user:
which you can store before save:
class ::User before_save :store_unique_number def store_unique_number self.custom_fields['unique_number'] ||= rand(1000) # ^^ ps do something here to ensure the number is actually unique end end
which will be serialized out and can be accessed on the front end:
the problem is I don’t know how to add ruby code to my pluggin .actuly I don’t khow how to write ruby pluggin .is there any refrence for learning?