Sha256: abc0f05aa2fcba5d7b6dcf3cd2b198ffce9cd6898f6e204de3770bb7887c51fa

Contents?: true

Size: 880 Bytes

Versions: 1

Compression:

Stored size: 880 Bytes

Contents

Volontariat.UserBrainstormingsRoute = Ember.Route.extend
  model: (params) ->
    @controllerFor('user_brainstormings').set 'metadata', {}
    @controllerFor('user_brainstormings').set 'userSlug', params.user_slug
    @controllerFor('user_brainstormings').set 'page', params.page
    
    @store.findRecord('user', params.user_slug).then (user) =>
      @controllerFor('user_brainstormings').set 'userName', user.get('name')
    
    Ember.$.getJSON(
      "/api/v1/brainstormings.json?user_slug=#{params.user_slug}"
    ).then (json) =>
      @controllerFor('user_brainstormings').set 'metadata', json.meta
      @controllerFor('user_brainstormings').set 'brainstormings', json.brainstormings
    
      { name: params.user_name }

  setupController: (controller, model) ->
    controller.send('goToPageWithoutRedirect', controller.get('page'))
    controller.set('model', model)

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
voluntary_brainstorming-0.0.2 app/assets/javascripts/voluntary_brainstorming/routes/user_brainstormings_route.js.coffee