0
この質問は別の投稿Facebook iframe app being redirected out of canvas after user authorizationで尋ねられましたが、私は同じ問題を抱えており、投稿に記載されている修正を実装する方法を理解していません。彼らが固定コントローラを投稿した場合、それはすばらしいでしょう。ここに私のコントローラがあります。Rails Facebookのiframeアプリケーションがユーザー認証後にキャンバスからリダイレクトされる
class AppController < ApplicationController
def index
@oauth = Koala::Facebook::OAuth.new("APP_ID", "APP_SECRET", "https://quiet-mist-8418.heroku.com/app/redirect")
if (session[:access_token].blank?)
redirect_to @oauth.url_for_oauth_code and return
end
@graph = Koala::Facebook::API.new(session[:access_token])
@friends = @graph.get_connections("me", "friends").to_s
end
def redirect
@oauth = Koala::Facebook::OAuth.new("APP_ID", "APP_SECRET", "https://quiet-mist-8418.heroku.com/app/redirect")
session[:access_token] = @oauth.get_access_token(params[:code]) if params[:code]
redirect_to(:action=>"index")
end
end