diff --git a/README.md b/README.md index a833a98..8c82870 100644 --- a/README.md +++ b/README.md @@ -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 @@ -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 diff --git a/hashid-rails.gemspec b/hashid-rails.gemspec index 698ca60..361e461 100644 --- a/hashid-rails.gemspec +++ b/hashid-rails.gemspec @@ -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