문제

I'm using the friendly_id gem (Rails 3.2) and I want a specific action (edit) to not use the friendly id slug. How can i do this?

Example:

for show action: "site.com/object/friendly_id"
for edit action: "site.com/object/id/edit"

Is this possible? Thanks

도움이 되었습니까?

해결책

Instead of using object send id as a parameter with path, for example, use this, for edit

edit_user_path(@user.id)

for show,

user_path(@user)
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top