2017-04-30 10 views
1

私の会社では、大規模なレールアプリケーションを5 apiモードのみを使用して書き直しています。可能なフロントエンドとしてember.jsを評価していました。別のアプリケーションで使用され、nginxによって提供されます。私はlocalhostに関する私のテストで問題に遭遇しました。あなたが修正プログラムやパッチをアドバイスできることを願っています。URLにアンダースコアの代わりにapiコールにダッシュが付いています

// APP /アダプター/

import DS from 'ember-data'; 
import DataAdapterMixin from 'ember-simple-auth/mixins/data-adapter-mixin'; 
import config from '../config/environment'; 

export default DS.JSONAPIAdapter.extend(DataAdapterMixin, { 
host: ${config.host}, 
authorizer: 'authorizer:jwt', 
namespace: 'api/v1' 
}); 

//アプリ/モデル/デバイスprofile.js

import DS from 'ember-data'; 

export default DS.Model.extend({ 
name: DS.attr('string'), 
devices: DS.hasMany('device'), 
assignedFlags: DS.hasMany('assigned-flag'), 
deviceProfileGpios: DS.hasMany('device-profile-gpio') 
}); 

// APP /ルート/デバイスprofiles.js

をapplication.js
import Ember from 'ember'; 

export default Ember.Route.extend({ 
model() { 
return this.store.findAll('device-profile') 
} 
}); 

私はhttp://localhost:4200/device-profilesに行くとき、私は私のレールコンソール

に、次の404エラーを取得するに
Started GET "/api/v1/device-profiles" for ::1 at 2017-04-30 08:10:30 -0400 

ActionController::RoutingError (No route matches [GET] "/api/v1/device-profiles"): 

いくつかの設定がありますか、これはバグですか?

答えて

0

は、私は自分のアプリケーションアダプタにこれを追加

燃えさしデータgithubのサイト上の問題に答えを見つけることができた

pathForType: function(type) { 
    var underscored = Ember.String.underscore(type); 
    return Ember.String.pluralize(underscored); 
} 
関連する問題