0.01
No commit activity in last 3 years
No release in over 3 years
Box.net/Box.com integration for CarrierWave.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

~> 1.10
~> 10.0
>= 0

Runtime

 Project Readme

Carrierwave::Box

Now you can use box.net/box.com with Carrierwave.

Easy to config, easy use, and helpful.

You can use box.net/box.com to store image (i was check, it working with rails to show image in view).

Gem will auto generater access token, don't worry about access token. :D

Installation

Add this line to your application's Gemfile:

gem 'carrierwave-box'

And then execute:

$ bundle

Or install it yourself as:

$ gem install carrierwave-box

##Note:

In your developer web view, you need to set return uri to: http://localhost

Usage

So simple:

  • Config for carrierwave:

        CarrierWave.configure do |config|
          config.box_client_id = 'your_client_id'
          config.box_client_secret = 'your_secret_id'
          config.box_email = 'your_box_email'
          config.box_password = 'your_box_password'
          config.box_access_type = "box"
          config.cache_dir = "#{Rails.root}/tmp/uploads"
          config.enable_processing = true
        end

Special of this gem:

- Gem will auto generater access token.

- No need time to get access token.

- Why box.net/box.com is so difficult to do gem: Access token is only valid in 60 minutes. :(

- With gem you can easy to use, but notice time to upload will be longer. (it depend your internet and your vps/computer).
  • How to integate:

      class FileUpload < ActiveRecord::Base
        # Upload picture
        mount_uploader :file_name, AbcUploader
      end
      class AbcUploader < CarrierWave::Uploader::Base
        # Include RMagick or MiniMagick support:
        # include CarrierWave::RMagick
        # include CarrierWave::MiniMagick
        # Choose what kind of storage to use for this uploader:
        storage :box
      end
  • To show image in view with Rails

    EX:

    = image_tag FileUpload.last.file_name.url

TODO

  • Test, test and test...

  • Improvement speed.

Contributing

Bug reports and pull requests are welcome on GitHub at https://github.com/thiensubs/carrierwave-box. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the Contributor Covenant code of conduct.

License

Copyright (c) 2015 thiensubs - Vo Tien An The gem is available as open source under the terms of the MIT License.