Is there a way to access the FriendlyID slug generator from an instance of a model that extend FriendlyId?
And then pass it a string to have a unique slug generated?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Below is one option for accessing the generator from the model. With this you can just include the
:url_nameor whatever you want to call it, in your form for making the object. In my case it is set up so if a string is not entered it sets the url_name to something else.Also, this is a little older but for more information on FriendlyID checkout this railscast