Skip to content

Commit

Permalink
Clarify globalize slug documentation further
Browse files Browse the repository at this point in the history
It should now be clear that both the model's table and the model's
translation table must have a slug field, and the model must declare the
slug field translatable.
  • Loading branch information
robyurkowski committed Jul 4, 2012
1 parent 30e663d commit 7b9a30d
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
5 changes: 3 additions & 2 deletions Guide.rdoc
Original file line number Diff line number Diff line change
Expand Up @@ -480,8 +480,9 @@ languages. If your application only needs to be localized to one or two
languages, you may wish to consider the {FriendlyId::SimpleI18n SimpleI18n}
module.

In order to use this module, your model's translation table must have a slug
column and must set the field +slug+ as translatable with Globalize:
In order to use this module, your model's table and translation table must both
have a slug column, and your model must set the +slug+ field as translatable
with Globalize:

class Post < ActiveRecord::Base
translates :title, :slug
Expand Down
5 changes: 3 additions & 2 deletions lib/friendly_id/globalize.rb
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,9 @@ module is most suitable for applications that need to be localized to many
languages, you may wish to consider the {FriendlyId::SimpleI18n SimpleI18n}
module.
In order to use this module, your model's translation table must have a slug
column, and you must set the field +slug+ as translatable with Globalize:
In order to use this module, your model's table and translation table must both
have a slug column, and your model must set the +slug+ field as translatable
with Globalize:
class Post < ActiveRecord::Base
translates :title, :slug
Expand Down

0 comments on commit 7b9a30d

Please sign in to comment.