Skip to content

Change :model-name_id to :model_name_id in defining routes doc - #1168

Merged
jenweber merged 1 commit into
ember-learn:masterfrom
raycohen:route-dynamic-segment-fix
Nov 15, 2019
Merged

jenweber merged 1 commit into
ember-learn:masterfrom
raycohen:route-dynamic-segment-fix

Conversation

@raycohen

@raycohen raycohen commented Nov 6, 2019 •

Copy link
Copy Markdown

:model-name_id implies that a multiword model would be dasherized with _id appended at the end. I think this is incorrect?

This doesn't work with the routes-segments-snake-case lint rule which will complain about the dash in the dynamic segment, and it also means that you'd need to use params['blog-post_id'] instead of params.blog_post_id which I don't think was intended by the original author here.

… models should name their dynamic segment
@amyrlam amyrlam self-assigned this Nov 13, 2019

@jenweber jenweber left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for your help with this! I think the fact that {path: 'blog-posts/blog-post_id'} trips up linting is confirmation that we should make this change.

In case you do more work in the future, for most PRs, you can submit changes to just the release version.

@jenweber
jenweber merged commit 86dee7d into ember-learn:master Nov 15, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants