norman / friendly_id
- Source
- Commits
- Network (50)
- Issues (4)
- Downloads (23)
- Wiki (1)
- Graphs
-
Branch:
master
| name | age | message | |
|---|---|---|---|
| |
.gitignore | Wed Jan 20 09:22:38 -0800 2010 | |
| |
Changelog.md | Tue Feb 09 15:57:34 -0800 2010 | |
| |
Contributors.md | Thu Feb 04 12:09:29 -0800 2010 | |
| |
Gemfile | Fri Jan 29 04:37:51 -0800 2010 | |
| |
Guide.md | Thu Feb 04 08:38:04 -0800 2010 | |
| |
LICENSE | Wed Jan 27 06:39:28 -0800 2010 | |
| |
README.md | Tue Feb 09 15:49:11 -0800 2010 | |
| |
Rakefile | Thu Feb 04 11:59:37 -0800 2010 | |
| |
extras/ | Thu Feb 04 11:59:37 -0800 2010 | |
| |
friendly_id.gemspec | Thu Feb 04 08:35:03 -0800 2010 | |
| |
generators/ | Mon Feb 01 11:12:33 -0800 2010 | |
| |
lib/ | Tue Feb 09 15:50:15 -0800 2010 | |
| |
rails/ | Thu Feb 04 08:36:03 -0800 2010 | |
| |
test/ | Thu Feb 04 08:35:47 -0800 2010 |
FriendlyId
FriendlyId is the "Swiss Army bulldozer" of slugging and permalink plugins for Ruby on Rails. It allows you to create pretty URL's and work with human-friendly strings as if they were numeric ids for ActiveRecord models.
Using FriendlyId, it's easy to make your application use URL's like:
http://example.com/states/washington
instead of:
http://example.com/states/4323454
FriendlyId Features
FriendlyId offers many advanced features, including: slug history and versioning, scoped slugs, reserved words, custom slug generators, and excellent Unicode support. For complete information on using FriendlyId, please see the {http://norman.github.com/friendly_id/file.Guide.html FriendlyId Guide}.
Rails Quickstart
gem install friendly_id
rails my_app
cd my_app
# add to config/environment.rb
config.gem "friendly_id", :version => ">= 2.3.0"
./script/generate friendly_id
./script/generate scaffold user name:string cached_slug:string
rake db:migrate
# edit app/models/user.rb
class User < ActiveRecord::Base
has_friendly_id :name, :use_slug => true
end
User.create! :name => "Joe Schmoe"
./script/server
GET http://0.0.0.0:3000/users/joe-schmoe
Docs, Info and Support
Bugs:
Please report them on the Github issue tracker for this project.
If you have a bug to report, please include the following information:
- Stack trace and error message.
- Version information for FriendlyId, Rails and Ruby.
- Any snippets of relevant model, view or controller code that shows how your are using FriendlyId.
If you are able to, it helps even more if you can fork FriendlyId on Github, and add a test that reproduces the error you are experiencing.
Credits:
FriendlyId was created by Norman Clarke, Adrian Mugnolo, and Emilio Tagua.
Copyright (c) 2008-2010, released under the MIT license.
