1

目前,我目前正在使用考拉 1.4.0 做开放图。

我确实创建了一个动作类型:查看对象类型:

我目前希望归档的是:当单击页面上的查看按钮时,在 facebook 代码上,它将显示,用户正在查看广告。

我得到的错误:

    HTTP 500: Response body: {"error":{"type":"Exception","message":"The action you're trying to publish is invalid because it does not specify any reference objects. At least one of the following properties must be specified: advertisement."}}

我如何尝试这样做:

graph = Koala::Facebook::API.new(@user.token)
graph.put_connections("#{@user.uid}", "namespace:View" , :object=>"#{url_for(@advertisement)}"

它在我的显示控制器中。在我的 show.html.erb 中,我确实包含了所有元数据。我也使用 koala 对 Facebook 功能进行了分享,它运行良好,并成功地从我的页面获取元数据并将其发布到 Facebook。

使用导轨 3.0.9。

4

2 回答 2

1

我对 Koala 不熟悉,但您似乎应该在 graph.put_connections 调用中使用 ':advertisement' 代替 ':object' 。例子:

graph.put_connections("#{@user.uid}", "namespace:View" , :advertisement=>"#{url_for(@advertisement)}"
于 2012-04-27T10:20:22.030 回答
1

这对我有用:

@graph.put_connections("me", "namespace:action", :object => object_url)

于 2012-05-10T18:12:10.300 回答