Closed eemi closed 13 years ago
Hi Emiliano,
The easiest way is to define two methods: one for your slug source e.g;
def full_name
"#{first_name} #{last_name}"
end
And then a second one, full_name_changed? - essentially,
def full_name_changed?; first_name_changed? || last_name_changed?; end
With that done, you should be able to do is_sluggable :full_name
and it'll do it's magic - If not, let me know and I'll fix it to make it work since that's a bug.
Thank you very much. I will try this!
I'm working on a project where I need to concatenate two fields and then get a slugg from them.
I can achieve this by creating an extra field, but this means having that extra field just for this. I was wondering if this could be done with slugged directly.
Thanks in advance, Emiliano