README.markdown in sluggable_finder-2.1.1 vs README.markdown in sluggable_finder-2.2.0
- old
+ new
@@ -50,9 +50,22 @@
end
# Provide a list or reserved slugs you don't want available as permalinks
#
sluggable_finder :title, :reserved_slugs => %w(admin settings users)
+
+### Extra configuration
+
+By default, Integer-like permalinks will fallback to normal ActiveRecord IDs, so
+
+ Comment.find '1234'
+
+... Will look in the ID column instead of the slug column.
+If you're using Integer-like strings in your slug column, you can ignore integer ID lookup completely with:
+
+ class Comment < ActiveRecord::Base
+ sluggable_finder :title, :allow_integer_ids => false
+ end
### Controllers
You can do Model.find(slug) just how you would with a single numerical ID. It will also raise a RecordNotFound exception so you can handle that in your application controller.
The idea is that you keep your controller actions clean and handle Not Found errors elsewhere. You can still use Model.find the regular way.
\ No newline at end of file