Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Use the request slug instead of the whole path (#708)
The current example code only works correctly for the `#show` action. If the user is using `find_post` for anything other than `#show`, it will re-direct a URL for `#edit` using the new slug to the `#show` for the new slug, making it impossible to edit (or update or destroy) Note that this will redirect from `/posts/old_slug/edit` to `posts/new_slug`, so from `#edit` to `#show`. The code I implemented actually checks to see if the action_name is 'edit', and if it is, re-direct to the correct edit path. For sake of simplicity, I think it's fine to have the docs re-direct to the `#show`.
- Loading branch information