This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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')); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 = {}; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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'); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// *** 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() { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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", |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{{view Ember.Select | |
prompt="Select one..." | |
contentBinding="controller.makes" | |
optionValuePath="content.id" | |
optionLabelPath="content.name" | |
valueBinding="controller.content.make.id" | |
class="span12"}} |