FriendlyIdSchema is a micro gem that combines FriendlyId with ActiveRecordSchema
Call #permalink
inside a model like this:
class Post
permalink
field :title
end
and then run rails g migration
with --from
option to let ActiveRecordSchema generate the required migration
ex.
rails g migration add_permalink_to_posts --from Post
class User
field :name
permalink :name
end
Run these commands first:
rails generate friendly_id
rake db:migrate
class Post
permalink :history => true
field :title
end