Skip to content

Commit

Permalink
Updated readme
Browse files Browse the repository at this point in the history
  • Loading branch information
jseifer committed Mar 16, 2008
1 parent 1f0b895 commit f11cc96
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions 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.