Linkedin宝石无法查看个人资料

问题描述

| 我已经为此苦苦挣扎好几天了,希望有人可以帮忙:) 使用linkedin gem和oauth_plugin连接到Linkedin。一切看起来都很好,但是我无法获得任何信息。 Twitter,facebook等都运转良好。 安装后,我遇到了\“ nil:NilClass \的未定义方法`downcase \'的问题,该问题通过在oauth选项中添加站点参数来解决。 现在几乎没有连接... 我的模型如下:
require \'linkedin\'
class LinkedinToken < ConsumerToken
  def client
    client = LinkedIn::Client.new(LinkedinToken.consumer.key,LinkedinToken.consumer.secret)
    client.authorize_from_access(token,secret)
    @client = client.profile
  end
end
节目:
Linkedin: <% @user.linkedin_token.client %>
我实际上没有任何输出!我到底在做什么错? -更新- 如果我将模型更改为:
require \'linkedin\'
class LinkedinToken < ConsumerToken
  def client
    oauth = LinkedIn::Client.new(LinkedinToken.consumer.key,LinkedinToken.consumer.secret)
    oauth.authorize_from_access(token,secret)
  end
end
并显示给:
<%= @user.linkedin_token.client %>
我最终得出以下结论:
[\"92af0f43-380d-45ef-90bb-a0a509c1baf0\",\"26c92c3f-1e84-458b-adc6-7b712a215222\"]
这也不对...     

解决方法

我对LinkedIn宝石一无所知,但是...在您的控制器中使用
@client
,在您的视图中使用
@user
    

相关问答

错误1:Request method ‘DELETE‘ not supported 错误还原:...
错误1:启动docker镜像时报错:Error response from daemon:...
错误1:private field ‘xxx‘ is never assigned 按Alt...
报错如下,通过源不能下载,最后警告pip需升级版本 Requirem...