Hi
Does anybody know of a good resource for a more complete description of the naming conventions in ember, with lots of useful examples?
I understand the system has a few core functions like camelize, dasherize, decamelize, underscore, classify, etc. But trying to understand how they are used downstream in the conventions.
In particular I am curious about what is specifically implied by MultiCamelCase naming.
By way of concrete example:
assume a specific view class I want to subclass elsewhere in the app
App.ModalView = Ember.View.extend({
// Common modal view implmentation...
});
With some subclass (the camel case is deliberately exaggerated)
App.ModalCrazyCamelCaseExampleView = App.ModalView.extend({
// specific events and functions
});
Elsewhere in one of my routers (or a controller) I have some specific event handler
modalOpen: function(){
this.render('modalcrazycamelcaseexample', { into: 'application', outlet: 'modal' })
}
I am confused about how to name the “context” that is passed to the render function and what to name the handlebars template. (note I am using ember-rails gem)
Given App.ModalCrazyCamelCaseExampleView
I am not sure the expected convention in this case
run-on naming
this.render('modalcrazycamelcaseexample', { into: 'application', outlet: 'modal' })
with
modalcrazycamelcaseexample.handlebars
or underscore naming
this.render('modal_crazy_camel_case_example', { into: 'application', outlet: 'modal' })
with
modal_crazy_camel_case_example.handlebars
or dasherized naming
this.render('modal-crazy-camel-case-example', { into: 'application', outlet: 'modal' })
with
modal-crazy-camel-case-example.handlebars
The guides don’t really have any extendedCamelCase examples as far as I can tell.
I am trying extend Adam Hawkings modal example.
But I can’t figure out why this doesn’t work