Reputation: 21
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 params[: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
Upvotes: 1
Views: 1460
Reputation: 9969
This is a rails controller not for ruby. For ruby you may refer to this tutorial and here is the DOCs for Ruby
Upvotes: 1