Posted
28 August 2009 @ 6pm

Tagged
, , , , ,

Share and Enjoy
  • del.icio.us
  • Facebook
  • Google Bookmarks
  • LinkedIn
  • Digg
  • Twitter
  • Reddit
  • MySpace
  • Technorati
  • StumbleUpon
  • Tumblr
  • Slashdot
  • email
  • Print

find_by_param for permalinks

A nice, clear, declarative means of doing something I’ve been writing code to do for years … find_by_param

From the README:


Find_by_param helps you dealing with permalinks and finding objects by our permalink value

class Post < ActiveRecord:Base
  make_permalink :with => :title
end

now you can do Post.find_by_param(...)

If you have a permalink-column find_by_param saves the permalink there and uses that otherwise it just uses the provided
attribute.

I love small and simple plugins.  Thanks to Michael Bumann.  Great job!


blog comments powered by Disqus
Handling ajax-y file uploads counter_cache as an optimization step