Requisites:
- Create a free account at https://www.mailgun.com/
- Save your API Key as a environment variables:
export MAILGUN_API_KEY=key-1111111111111111111111111
As example, I will use a model named Request
.
Requisites:
export MAILGUN_API_KEY=key-1111111111111111111111111
As example, I will use a model named Request
.
By default, Rails applications build URLs based on the primary key -- the id
column from the database. Imagine we have a Person
model and associated controller. We have a person record for Bob Martin
that has id
number 6
. The URL for his show page would be:
/people/6
But, for aesthetic or SEO purposes, we want Bob's name in the URL. The last segment, the 6
here, is called the "slug". Let's look at a few ways to implement better slugs.