Skip to content

Commit

Permalink
Clarify the usage instructions
Browse files Browse the repository at this point in the history
  • Loading branch information
jcypret committed Apr 12, 2015
1 parent 16eb88d commit 0b7967b
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
10 changes: 6 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# hashid-rails
# Hashid Rails

Hashid-Rails allows you to easily use [Hashids](http://hashids.org/ruby/) in your Rails app. Instead of your models using sequential numbers like 1, 2, 3, they will instead have unique short hashes like "yLA6m0oM", "5bAyD0LO", and "wz3MZ49l". The database will still use integers under the hood, so this gem can be added or removed at any time.
This gem allows you to easily use [Hashids](http://hashids.org/ruby/) in your Rails app. Instead of your models using sequential numbers like 1, 2, 3, they will instead have unique short hashes like "yLA6m0oM", "5bAyD0LO", and "wz3MZ49l". The database will still use integers under the hood, so this gem can be added or removed at any time.

## Installation

Expand All @@ -20,9 +20,11 @@ Or install it yourself as:

## Usage

Just use `Model#find` like normal:
Just use `Model#find` passing in the hashid instead of the model id:

@person = People.find(params[:id])
```ruby
@person = People.find(params[:hashid])
```

## Development

Expand Down
2 changes: 1 addition & 1 deletion hashid-rails.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ Gem::Specification.new do |spec|

spec.summary = %q{Use Hashids in your Rails app models.}
spec.description = <<-EOM
Hashid-Rails allows you to easily use [Hashids](http://hashids.org/ruby/)
This gem allows you to easily use [Hashids](http://hashids.org/ruby/)
in your Rails app. Instead of your models using sequential numbers like 1,
2, 3, they will instead have unique short hashes like "yLA6m0oM",
"5bAyD0LO", and "wz3MZ49l". The database will still use integers under
Expand Down

0 comments on commit 0b7967b

Please sign in to comment.