Any idea why would Avo keep an old resource slug a...
# avo-2
n
Any idea why would Avo keep an old resource slug after it has been updated?
l
can you give more context pls?
n
Hi @loud-jewelry-99127 Sorry I'm just seeing your message. I'm using friendly_id gem and I updated the slug on a record, and avo kept trying to link to the old slug when I hit the Edit button of that record.
It's fixed now, not sure if I fixed it by adding the method:
Copy code
def should_generate_new_friendly_id?
        title_changed?
    end
l
Yeah, that should fix it
n
to the resource, but again I'm not sure if that did it
l
By default friendly Id gem generates the slug once, on creation
If you want to regenerate the slug on updates you should override that method you mentioned
4 Views