Skip to content
This repository has been archived by the owner on Sep 2, 2022. It is now read-only.
/ default_find_by Public archive

Simple permalinks rails plugin using to_param and redefined find methods

License

Notifications You must be signed in to change notification settings

timon/default_find_by

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

DefaultFindBy
=====

(Yet another) solution to literal URLs and permalinks.

After I found myself redefining to_param on my models and changing
controllers load code, I had created this plugin.

You give it a name of the field. It takes that name, defines to_param
to return value of that field, and makes find use
find_by_that_field when it is given the string.

Example
===

class Post < ActiveRecord::Base
  1. Post (id: integer, title: string, body: text)
    default_find_by :title
    end

Testing
===
To test this plugin, you’ll need rspec, rspec-rails and nakajima-acts_as_fu
gems installed.

Copyright © 2008 Artem Ignatiev, released under the MIT license

About

Simple permalinks rails plugin using to_param and redefined find methods

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages