0

RAILS API バックエンドに接続するために AngularJS で Restangular を使用しています。標準の RABL API サービスから Restangular を使用して問題なくデータを取得できますが、カスタムの Devise ログイン/ログアウト API コントローラーに POST しようとすると、応答が得られないようです。

私はこのコードをここでたどりました: http://lucatironi.github.io/tutorial/2012/10/15/ruby_rails_android_app_authentication_devise_tutorial_part_one/

  def create
    warden.authenticate!(:scope => resource_name, :recall => "#{controller_path}#failure")
    render :status => 200,
           :json => { :success => true,
                      :info => "Logged in",
                      :data => { :auth_token => current_user.authentication_token } }
  end

私の最初の推測では、上記の create メソッドの render が Restangular では機能しないという点で、RABL は何か正しいことを行っているということです。create メソッド用の RABL テンプレートを持っていませんが、必要ですか?

これに関するヘルプは大歓迎です。

4

1 に答える 1