Skip to content

Instantly share code, notes, and snippets.

View lukegalea's full-sized avatar

Luke Galea lukegalea

View GitHub Profile
#
# Wide-open CORS config for nginx
#
location / {
if ($request_method = 'OPTIONS') {
add_header 'Access-Control-Allow-Origin' '*';
#
CoachApp.IndexRoute = Ember.Route.extend
model: (params) ->
client_id = localStorage.getItem 'clientId'
localStorage.removeItem('clientId')
if CoachApp.get('token')? and client_id? and !isNaN(client_id, 10)
CoachApp.Client.findById client_id
afterModel: (client) ->
if client
App.Route.map () ->
@resource "clients", ->
@resource "client"
@resource 'coaches', ->
@resource 'coach', path: ':coach_id', ->
@resource 'coachedclients', path: '/clients'
App.Coachedclients = Ember.Route.extend
model: (params) ->