Ember Mentoring


#1

Anyone interested in being an Ember Mentor? What i mean is: being willing to spend a short amount of time on Google hangout or whatever getting a n00b up to speed?

I’ve read a lot of docs, watched a number of videos, but still struggling. :stuck_out_tongue:

I promise to pay the favor forward! If not its cool just thought I would throw it out there.


#2

Hi there, I am pretty new to Ember as well, but I do have a lot of the basics down. I understand the struggle. I dont have a lot of time for a hangout session, but if you have any questions you can post them here and I will share what I can.


#3

Cool thank you Sir! I will do the same if you have questions that maybe I can answer. I will figure this out. :stuck_out_tongue: So my first problem is this: XMLHttpRequest cannot load file:///C:/users. The request was redirected to ‘file:///C:/users/’, which is disallowed for cross-origin requests that require preflight.

My JS: App = Ember.Application.create({ LOG_TRANSITIONS: true });

App.Router.map(function() { this.resource(‘users’, function() { this.resource(‘user’, {path: ‘id’}); this.route(‘new’); }); });

App.User = DS.Model.extend({ firstName: DS.attr(‘string’), lastname: DS.attr(‘string’), username: DS.attr(‘string’), email: DS.attr(‘string’), phone: DS.attr(‘string’) });

App.ApplicationRoute = Ember.Route.extend({ model: function() { this.store.push(‘user’, { id: 1, firstname: ‘Peter’, lastname: ‘Sotos’, username: ‘psotos’, email: ‘psotos@epicproportionstour.com’, phone: ‘714-904-7310’ }); } });

App.IndexRoute = Ember.Route.extend({ model: function() { return this.store.find(‘user’); } });

App.BookingRoute = Ember.Route.extend({ model: function() { return [‘red’, ‘yellow’, ‘blue’]; } });

HTML

Ember Starter Kit

Ok I think I am answering my own question here…I need to have a users route defined somewhere.


#4

Also check out #emberjs on freenode, it’s quite active and lots of people giving help in realtime


#5

@psotos That first error message you display looks to me like you are trying to request ajax from your local computer, contacting a remote server.

That will not work out of the box with Ember-Data. Ember-Data automatically builds a URL to send requests to a server, and it assumes the app is already “out in the wild”.

If you want to use the store.find() method, and cant connect to a live server yet, you should use FIXTURE data, unless you can fanangle a mini http server that runs on your local computer.

Look up on the ember guides about using FIXTURES and the FIXTUREAdapter. It will let you use dummy data that you can fill your templates with.


#6

Ah thanks Grapho! This is the type of info I needed! :smile: