Skip to content

Instantly share code, notes, and snippets.

@biscuitvile
Created January 28, 2014 17:06
Show Gist options
  • Select an option

  • Save biscuitvile/8671781 to your computer and use it in GitHub Desktop.

Select an option

Save biscuitvile/8671781 to your computer and use it in GitHub Desktop.
class Api::V1::SitesController < Api::V1::BaseController
actions :show
def index
respond_with [ Site.find_by_subdomain(params[:subdomain]) ]
end
end
App.IndexRoute = Ember.Route.extend
model: ->
sitesPromise = @store.find('site', { subdomain: @get('currentDomain') })
sitesPromise.then -> sitesPromise.content.get('firstObject')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment