Friday, 8 May 2015

Using gem dropbox-sdk-ruby in Rails Application

Dropbox-sdk-ruby is a ruby library for the Dropbox core API.


1.Install Gem: you can run `gem install dropbox-sdk` from the terminal or  write following line in your gem file.

gem 'dropbox-sdk'

2. Using Gem: Create a file inside the config/initializers/ of your rails application.

There are following steps to use dropbox-sdk.

2.1 Require  gem inside your file:

 require 'dropbox_sdk'

2.2 Create an client_object of dropbox to use dropbox-api:

     @client = DropboxClient.new(YOUR_APP_SECRET_TOKEN)

2.3  Writing files to dropbox:

     @client.put_file(path_to_write, file, overwrite=true)

2.4 Read files to dropbox:

     @client.get_file(path, rev = revision)

Note: This is is onluy overview of this gem for more detail please click here.

No comments:

Post a Comment