I am trying to customize my display route ... I do not want users to be able to view items by: id ...
I have a sales model, and the delivery route:
sale GET /sales/:id(.:format) sales
But I donβt want users to be able to view sales by id, instead I would like to:
sale GET /sales/:guid(.:format) sales
The guide is the uuid that I generate when the object is created:
def populate_guid self.guid = SecureRandom.uuid() end
source share