OxenMedia

Dependencies

This gem depends (heavily) on the abstracted gem!

Installation

You install the oxen_media gem simply by adding it to your Gemfile like this

‘gem ’oxen_media’‘

Configuration

Once installed, you add the media table to your Rails DB migration management system like this

‘rails g media medium`

Don’t forget to migrate ;)

Now you’re ready to upload media - all you have to do is

  • add ‘has_many :media, as: :imageable, dependent: :destroy` to the model which media should be attached

  • add a medium_policy.rb to your policies

  • add ‘= render ’media/media’, f: f, medialist: ‘media’, url: new_stock_item_medium_url(resource)‘ to the model to which media should be attached

TODO

07-09-15 - use chocolat.insipi.de/ to ‘lightbox’ the images uploaded 07-09-15 - use iamceege.github.io/tooltipster/ for tips 03-07-15 - remember to install (on Linux) VIPS library like: $ apt-get install libvips-dev