Ember.js: Camel cased route template not rendering

Created on 4 Jan 2017  路  9Comments  路  Source: emberjs/ember.js

Tested with 2.10.2 and a few other version.

https://ember-twiddle.com/aa225e4aa416f47e6e501b7be0ca3ce1?openFiles=templates.application.hbs%2C&route=%2FforgotPassword

Clicking the 'Forgot Password' link takes you to the route, but nothing is rendered.
On another note, if you have two routes, forgotPassword and forgot-password, the dasherized version clobbers the camelcased one and makes it "work"..

See this here: https://ember-twiddle.com/39c3fc57cf6f544c4f7109c609da0bf5?openFiles=templates.application.hbs%2C

Has Reproduction Routing

All 9 comments

So this might not be a bug per say, just that camelcase named routes automatically look for dasherized files, but if a user has a camelcased file there should at least be a warning..

I'll put together an RFC for deprecating non-dasherized route names, so that in 3.0 we can remove the "magic" file name transforms.

I think we should hard error when a route with capital letter is detected. It is too easy for someone to get lost when there is no feedback for why their route isn't working.

We need to break out the globals parts of the resolver first.

@locks Can you explain why that is required to do this?

some of us like to define routes with uppercase characters. there should be some error feedback for this issue, but the idea of forbidding uppercase characters in routes seems extreme.

Path can be used to name the route however you want. This is mainly about naming the routes in the file system app layout/router definition.

ok. FWIW, this is what currently happens with blueprint generation on 3.0.0:

$ ember g route camelCaseBusiness
installing route
  create app/routes/camel-case-business.js
  create app/templates/camel-case-business.hbs
updating router
  add route camelCaseBusiness
installing route-test
  create tests/unit/routes/camel-case-business-test.js

https://github.com/ember-cli/eslint-plugin-ember/pull/70 added a linting rule to help guide folks down the right path here, I think thats all we can do at the moment so I'm going to go ahead and close...

Was this page helpful?
0 / 5 - 0 ratings