Sha256: 1032f83f8fcce8680b620125f1d08af9f5e55eaedaf1957c8e8ca095972e6fc6

Contents?: true

Size: 1.32 KB

Versions: 1

Compression:

Stored size: 1.32 KB

Contents

= Crimagify

Manage your model images with RMagick and CarrierWave.

== Installation
1. Add to your Gemfile: <tt>gem 'crimagify'</tt>
2. Run <tt>Bundle</tt>
3. Execute: <tt>rails generate crimagify:install</tt>
4. Run migrations: <tt>rake db:migrate</tt>
5. Run seeds: <tt>rake db:seed</tt>
----

== Implementation
Add to your routes.rb: <tt>mount Crimagify::Engine => "/crimagify", :as => "crimagify"</tt>

Add to your model:

    
    ...
    extend Crimagify::DinamicImageMethods
    has_many :crimagify_images, :as => :parent, :dependent => :destroy, :class_name => Crimagify::Image
    build_methods_images
    ...
		

Add to your controller:

    
    ...
    #For Action Create:
    if @object.save
    	Crimagify::ImageFunctions::create_new_images(@object, params)
    end
    ...

    ...
    #For Action Update:
    id @object.update_attributes(params[:object])
    	Crimagify::ImageFunctions::update_images(@object, params)
    end
    ...

Add to application.js:<tt>//= require crimagify/application</tt>

Add to application.css:<tt>*= require crimagify/application</tt>

Add to your form view:

    
    <%= form_for(@object) do |f| %>
    ...
    <%= images_id(@object) %>
    <%= image_cropper(@object, { image_name: "imgA", ratio: :big}) %>
    <%= image_cropper(@object, { image_name: "imgB", ratio: :small}) %>
    ...
    <% end %>

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
crimagify-0.0.2 README.rdoc