0

i'm trying to use (Friendly_Id 5.0.0.Beta4) in (Rails 4) with 2 models but just work with one.

I have this models:

class Author < ActiveRecord::Base
has_many :articles
extend FriendlyId
friendly_id :name, use: :slugged
end

class Category < ActiveRecord::Base
has_many :articles
extend FriendlyId
friendly_id :title, use: :slugged
end

But friendly_id just work with Author model. Can anyone helpme?

mijailr
  • 71
  • 1
  • 12
  • What do your attributes look like in each table? If you using SQLite run sqlite3 -line db/development.sqlite3 so you can run the query 'SELECT * FROM author' and 'SELECT * FROM Category' – Adrian Elder Sep 22 '13 at 22:18

1 Answers1

0

Can you be more specific about the error you are facing. In rails 4, friendly_id will not automatically overwrite the active record finders. and you should do that manually.

Check here for friendly_id implementation of rails 4 .

http://kapilrajnakhwa.com/blogs/user-friendly-urls-with-friendly_id-gem-in-rails-4

xecutioner
  • 311
  • 3
  • 15