开发者

Dropbox Ruby API

I want to use Dropbox Ruby API, I installed the gem and when I want to create a dropbox session I got this message:

uninitialized constant DropboxController::Dropbox

Is there anything to do if I want to use this api except install the gem?

The code is:

def authorize
  if p开发者_运维技巧arams[:oauth_token] then
    dropbox_session = Dropbox::Session.deserialize(session[:dropbox_session])
    dropbox_session.authorize(params)
    session[:dropbox_session] = dropbox_session.serialize # re-serialize the authenticated session
    redirect_to :action => 'upload'
  else
    dropbox_session = Dropbox::Session.new('your_consumer_key', 'your_consumer_secret')
    session[:dropbox_session] = dropbox_session.serialize
    redirect_to dropbox_session.authorize_url(:oauth_callback => url_for(:action => 'authorize'))
  end
end


This is a rails controller not for ruby. For ruby you may refer to this tutorial and here is the DOCs for Ruby


Require the dropbox file in your current file.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜