# app/models/post.rb
class Post < ApplicationRecord
  has_prefix_id :post
end
```

View [prefixed_ids](https://github.com/excid3/prefixed_ids) setup in action: [View Demo](https://main.avodemo.com/avo/resources/teams)

Check out the code: [Code on GitHub](https://github.com/avo-hq/main.avodemo.com/blob/main/app/models/team.rb)

## Example with Hashids

Hashid Rials is a gem that generates short, unique, and cryptographically secure IDs.

**Install [hashid-rails](https://github.com/jcypret/hashid-rails) gem by adding this line to your application's Gemfile:**

```ruby
gem "hashid-rails", "~> 1.0"
```

And then execute:

```bash
bundle install
```

**Include Hashid Rails in the ActiveRecord model you'd like to enable hashids:**

```ruby{3}