Skip to content

Instantly share code, notes, and snippets.

{{#link-to "projects.edit" view.content.id class="mal-name"}}
<span>
{{view.content.name}} <--- This renders
{{#if view.content.name}}
{{view.content.name}} <--- We get to this, but it renders nothing.
{{else}}
Missing Project Name
{{/if}}
</span>
{{/link-to}}
@cloke
cloke / gist:6323765
Last active December 21, 2015 14:59
#in template
{{tb-select value=market_po options=controllers.menus.markets}}
#Work in progress
Ember.TEMPLATES['components/tb-select'] = Em.Handlebars.compile '
{{view view.OptionsView}}
'
Binders.TbSelectComponent = Ember.Component.extend
#In template
{{tb-select options=controllers.menus.pods value=pod}}
#Work in progress
Ember.TEMPLATES['components/tb-select'] = Em.Handlebars.compile '
<div class="controls">
{{view view.OptionsView}}
</div>
'
#this must run before application.create.
DS.RESTAdapter.map 'App.ParentModel',
foos: { embedded: 'always' } #has many
bars: { embedded: 'always' } #has one aka belongsTo
App.ParentModel = DS.Model.extend
foos: DS.hasMany App.Foo
bars: DS.belongsTo App.Bar
DS.RESTAdapter = DS.RESTAdapter.extend({
serializer: DS.RESTSerializer.extend({
primaryKey: function(type) {
return '_id';
}
})
})
dogarrhea: out of curiosity, why did ember marketing decide to attach the "MVC" label to ember.js when ember doesn't really have a data solution that's solid yet?
[12:32pm] mixonic joined the chat room.
[12:32pm] dogarrhea: it's pretty deceptive and leaves a bad taste in my mouth when I use it and find out. This is the opposite of what marketing wants right?
[12:32pm] alexd08 left the chat room. (Quit: This computer has gone to sleep)
[12:33pm] dogarrhea: i'll just stop until everything is ready. not provide free QA
<ul>
{{#each song in songs}}
<li>{{song.title}}</li>
{{/each}}
</ul>
MyListView: Em.CollectionView.extend
tagName: 'ul'
itemViewClass: Em.View.extend
template: Em.Handlebars.compile '
Binders.SpotsNewRoute = Binders.ModalEditRoute.extend
model: (params) ->
m = Binders.Spot.createRecord()
m.setProperties
account_service: Binders.AccountService.createRecord()
agency_production: Binders.AgencyProduction.createRecord()
creative: Binders.Creative.createRecord()
digital: Binders.Digital.createRecord()
planner: Binders.Planner.createRecord()
@cloke
cloke / gist:5666885
Last active December 17, 2015 20:19
#The code before the update. Used to work, but now it breaks.
Binders.SpotsEditRoute = Em.Route.extend
model: () ->
Binders.Spot.find 1234
Binders.Router.map ->
@resource 'spots', ->
@route 'new'
@route 'edit', { path: ':spot_id/edit' }
@cloke
cloke / response
Last active December 14, 2015 02:39 — forked from fredjiles/response
DS.RESTAdapter.map('App.Database', {
primaryKey: 'name'
collections: { embedded: 'load' }
});
DS.RESTAdapter.map('App.Collection', {
primaryKey: 'name'
});