I have a URL that looks like this:
http://localhost:3000/activities/5NcsdzWvXbv
I'd like to make it look something like this:
http://localhost:3000/activities/river-rafting
I have a column in my non-activerecord database that stores the names of activities that I'd like to use instead of the id.
I've taken a look at friendly_ID gem but it looks like it won't work for me because of the way my model is set up.
class Leads
include ActiveAttr::Model
end
Is there an easy solution to this?
I checked out an old rails question that recommended doing this:
def to_param
self.name
end
This wouldn't work for me as my model file isn't connected to activerecord but instead an external nosql database.
Can I just make some modifications to my routing file or is there some other way to modify my URL?
Thanks for your time.