This repository is private.
All pages are served over SSL and all pushing and pulling is done over SSH.
No one may fork, clone, or view it unless they are added as a member.
Every repository with this icon (
) is private.
Every repository with this icon (
This repository is public.
Anyone may fork, clone, or view it.
Every repository with this icon (
) is public.
Every repository with this icon (
Francesc Esplugas (author)
Mon Apr 13 02:57:45 -0700 2009
commit 0747e41bd03ca5150b27e8fa194cd85b5f22e53d
tree 985286383374b0d62c89c86b286587699cdd2ee1
parent f54d53f5ab95d35e24b421fc4dcc7ff830aea21f
tree 985286383374b0d62c89c86b286587699cdd2ee1
parent f54d53f5ab95d35e24b421fc4dcc7ff830aea21f
| name | age | message | |
|---|---|---|---|
| |
MIT-LICENSE | ||
| |
README.rdoc | ||
| |
Rakefile | ||
| |
init.rb | ||
| |
lib/ | ||
| |
test/ |
README.rdoc
Simplified Permalink
I know there are some plugins out there that do the same, but this one fits my needs.
Example
Add to your posts the permalink attribute.
add_column :posts, :permalink, :null => false
add_index :posts, :permalink
And use it on your models.
class Post < ActiveRecord::Base
permalink :title
permalink :title, :slug # If you want to use a custom attribute.
end
So now you can find your posts with:
class Posts < ApplicationController
def show
@post = Post.find_by_permalink_and_status!(params[:id])
end
end
About the Author
Francesc Esplugas - francescesplugas.com
Copyright © 2008-2009 Francesc Esplugas Marti, released under the MIT license








