Skip to content

Instantly share code, notes, and snippets.

@aboma
aboma / ember.editControllerMixin.js
Created July 17, 2013 19:06
Universal edit controller mixin for ember.js. Use on all controllers that create, update and delete records.
// Mixin to generalize model create/edit functionality
// for use in controllers. Typical use in route:
// Vilio.PortfolioEditRoute = Ember.Route.extend({
// // create transaction and add model to it
// setupController: function(controller, model) {
// this._super(controller, model);
// this.store.transaction().add(model);
// },
// events: {
// cancel: function() {
@aboma
aboma / ember.select2.js
Last active February 7, 2021 17:07
select2.js enabled select box view for ember.js
// Select box utilizing Select2 functionality that overrides Ember.Select;
// Define view in the same way that you would an Ember.Select view.
// Additional attributes supported are: width, allowClear, and closeOnSelect;
// Example view:
// {{ view App.Select2
// viewName="fieldValueSelect2"
// prompt="Please select a value list"
// contentBinding="controller.fieldValuesLists"
// optionLabelPath="content.name"
// optionValuePath="content.id"