Pregunta

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

¿Fue útil?

Solución

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)
Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow
scroll top