Skip to content

Instantly share code, notes, and snippets.

Started GET "/a" for 127.0.0.1 at 2013-05-15 21:44:07 -0700
Processing by HomeController#index as HTML
Parameters: {"ember"=>"a"}
Rendered home/index.html.erb within layouts/application (0.0ms)
Compiled adapter.js (0ms) (pid 8216)
Compiled application.js (15ms) (pid 8216)
Completed 200 OK in 269ms (Views: 268.3ms | ActiveRecord: 0.0ms)
{{#each text in content.vehicleTexts}}
<div class="row-fluid">
{{view Bootstrap.Forms.Wysihtml5
valueBinding="text.text"
inputFieldClassNames="span12 text-description"
labelBinding="text.type.name"
}}
</div>
{{/each}}
uploadFile: function(file) {
var self = this,
vehicle = this.get('controller.content'),
photo = Case.VehiclePhoto.createRecord();
console.log(file.data);
photo.set('name', file.name);
photo.set('imageData', file.data);
photo.set('vehicleId', this.get('controller.content.id'));
Case.RESTAdapter = DS.RESTAdapter.extend({
serializer: Case.RESTSerializer,
createRecord: function(store, type, record) {
if(type == 'Case.VehiclePhoto') {
this.createPhotoRecord(store, type, record);
} else {
var root = this.rootForType(type);
var data = {};
Case.UploadFileView = Ember.TextField.extend({
type: 'file',
attributeBindings: ['name', 'multiple'],
change: function(evt) {
var self = this;
var input = evt.target;
if (input.files && input.files[0]) {
for(var i = 0; i < input.files.length; ++i) {
var reader = new FileReader();
var that = this;
unselectedOptions: function() {
var options = this.content.get('vehicleOptions');
var filterOptions = this.get('VehicleOptions').filter(function(option) {
if(options.contains(option)) {
return false;
}
return true;
});
return filterOptions.sort(function(a,b){
return a.get('name') - b.get('name');
Started GET "/" for 127.0.0.1 at 2013-04-11 01:07:05 -0700
Processing by HomeController#index as HTML
Rendered home/index.html.erb within layouts/application (0.0ms)
Completed 200 OK in 67ms (Views: 66.8ms | ActiveRecord: 0.0ms)
Started GET "/assets/application.css?body=1" for 127.0.0.1 at 2013-04-11 01:07:05 -0700
// *** WHY DOES THIS FILE EXIST ***
//
// For some godawful reason, ember-data's StateManager was written in a closure
// and I can't figure out a way to extend it, which is terrible because I really
// needed to. So, I copied over most of the closure here and reinstantiated
// the states var, which meant I needed a whole bunch of other stuff from the
// closure, and then I reopened DS.StateManager and set states to the new,
// modified states var. Replace this asap, please.
(function() {
Ember.Application.initializer({
name: "showrooms",
initialize: function(container, application) {
container.optionsForType('showroom', { instantiate: false, singleton: true });
container.register('showroom', 'current', Case.Showroom.find());
}
});
Ember.Application.initializer({
name: "injectShowrooms",
{{view Ember.Select
prompt="Select one..."
contentBinding="controller.makes"
optionValuePath="content.id"
optionLabelPath="content.name"
valueBinding="controller.content.make.id"
class="span12"}}