MediaInclude
Includes Images and videos your models
Installation
Add this line to your application's Gemfile:
gem 'media_include'
And then execute:
$ bundle
Or install it yourself as:
$ gem install media_include
Usage
To generate the image and video models
rails generate media_include:install
rake db:migrate
Now we are going to attach images to Post model
class Post < ActiveRecord::Base
attr_accessible :title
accept_images
end
In the form
= nested_form_for @post do |f|
= f.input :title
=render :partial => "layouts/load_images", :locals => {:f => f}
= f. :submit
Contributing
- Fork it
- Create your feature branch (
git checkout -b my-new-feature) - Commit your changes (
git commit -am 'Add some feature') - Push to the branch (
git push origin my-new-feature) - Create new Pull Request
To do
Try version 14, if works uninstall and reset version to 1