0

I am using friendly_id and I want to make each user's post page address friendly.
For example
user/name/post/name
user/name is not duplicated, but post/name can be duplicated.
I thought if I use user/name/post/name then the pages are different but actually they are the same.
Is there any way to make friendly address like user/name/post/name ?
(user/name is not duplicated, but post/name can be duplicated)

suusmu
  • 1

1 Answers1

0

I found answer myself.
In show action in users controller

def show
    @user = User.friendly.find(params[:user_id])
    @entry = @user.entries.friendly.find(params[id])
....

Then for example
user/nameA/post/nameA
user/nameB/post/nameA
can be different.

suusmu
  • 1