Permalink
Browse files

Updated readme

  • Loading branch information...
1 parent 1f0b895 commit f11cc96699d7e4333e4ce2496ee02f11ad2e4aac @jseifer committed Mar 16, 2008
Showing with 13 additions and 0 deletions.
  1. +13 −0 README
View
13 README
@@ -0,0 +1,13 @@
+This is a silly plugin to let you take a shortcut. Here's the blog post example:
+
+class Post < ActiveRecord::Base
+ define_find_param :slug
+end
+
+This will set the to_param to be post.slug and add the following method to the Post model:
+
+def self.find_by_param(*args)
+ find_by_slug(*args)
+end
+
+Like I said, it's silly, but I find myself using this pattern a lot.

0 comments on commit f11cc96

Please sign in to comment.