Skip to content
This repository
Newer
Older
100644 92 lines (60 sloc) 2.836 kb
8777f069 »
2011-06-25 Initial commit to 4.0.0
1 <hr>
2 **NOTE** This is FriendlyId4 - a rewrite of FriendlyId. For more info about this
3 rewrite, and the changes it brings, read [this
4 document](https://github.com/norman/friendly_id_4/blob/master/ABOUT.md).
5
6 For the current stable FriendlyId, please see:
7
8 [https://github.com/norman/friendly_id](https://github.com/norman/friendly_id_4)
9 <hr>
10 # FriendlyId
11
12 FriendlyId is the "Swiss Army bulldozer" of slugging and permalink plugins for
13 Ruby on Rails. It allows you to create pretty URL's and work with
14 human-friendly strings as if they were numeric ids for Active Record models.
15
16 Using FriendlyId, it's easy to make your application use URL's like:
17
18 http://example.com/states/washington
19
20 instead of:
21
22 http://example.com/states/4323454
23
24 ## FriendlyId Features
25
26 FriendlyId offers many advanced features, including: slug history and
27 versioning, scoped slugs, reserved words, custom slug generators, and
28 excellent Unicode support. For complete information on using FriendlyId,
29 please see the [FriendlyId Guide](http://norman.github.com/friendly_id/file.Guide.html).
30
31 FriendlyId is compatible with Active Record **3.0** and **3.1**.
32
33 ## Docs, Info and Support
34
35 * [FriendlyId Guide](http://norman.github.com/friendly_id/file.Guide.html)
36 * [API Docs](http://norman.github.com/friendly_id)
37 * [Google Group](http://groups.google.com/group/friendly_id)
38 * [Source Code](http://github.com/norman/friendly_id/)
39 * [Issue Tracker](http://github.com/norman/friendly_id/issues)
40
41 ## Rails Quickstart
42
43 gem install friendly_id
44
45 rails new my_app
46
47 cd my_app
48
49 # add to Gemfile
50 gem "friendly_id", "~> 4.0.0"
51
52 rails generate scaffold user name:string slug:string
53
54 # edit db/migrate/*_create_users.rb
55 add_index :users, :slug, :unique => true
56
57 rake db:migrate
58
59 # edit app/models/user.rb
60 class User < ActiveRecord::Base
61 include FriendlyId::Slugged
62 has_friendly_id :name
63 end
64
65 User.create! :name => "Joe Schmoe"
66
67 rails server
68
69 GET http://localhost:3000/users/joe-schmoe
70
71 ## Bugs
72
73 Please report them on the [Github issue tracker](http://github.com/norman/friendly_id/issues)
74 for this project.
75
76 If you have a bug to report, please include the following information:
77
78 * **Version information for FriendlyId, Rails and Ruby.**
79 * Stack trace and error message.
80 * Any snippets of relevant model, view or controller code that shows how your
81 are using FriendlyId.
82
83 If you are able to, it helps even more if you can fork FriendlyId on Github,
84 and add a test that reproduces the error you are experiencing.
85
86 ## Credits
87
88 FriendlyId was created by Norman Clarke, Adrian Mugnolo, and Emilio Tagua, and
89 has had significant contributions over the years from [many
90 volunteers](https://github.com/norman/friendly_id/contributors).
91
92 Copyright (c) 2008-2011 Norman Clarke, released under the MIT license.
Something went wrong with that request. Please try again.