Sha256: 0735b3ef1abcd870cf481a1861a03bc7c0b1033e6bdb1d923599879746bb7e03

Contents?: true

Size: 1.08 KB

Versions: 6

Compression:

Stored size: 1.08 KB

Contents

= Avatars For Rails

Avatars For Rails is a integral solution to provide a model with avatar support.

It includes a database migration and views with jquery.fileupload and jquery.jcrop

It relies on paperclip and imagemagick

= Installation

Add to your Gemfile:

  gem 'avatars_for_rails'

and run:

  bundle update

Then, if you have a class named actor and you want it to have avatars, run:

  rails generate avatars_for_rails:install user

This will generate the following:

* A initializer file with configuration for avatars_for_rails.
* A migration providing the database schema for using avatars_for_rails with the actor class.

Do not forget to migrate your database

  rake db:migrate
  
In your model, you must include:

  class User < ActiveRecord::Base
    acts_as_avatarable
  end

For rendering the new avatar form:
  <%= render :partial => 'form' %>
  
You must include the javascript and css files

  //= require avatars_for_rails

 
If you want to get an actor's avatar you can do: 
  user.logo
  
For rendering an image_tag for an user's avatar:
  <%= image_tag(user.logo.url(:style) ) %>

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
avatars_for_rails-1.0.5 README.rdoc
avatars_for_rails-1.0.4 README.rdoc
avatars_for_rails-1.0.3 README.rdoc
avatars_for_rails-1.0.2 README.rdoc
avatars_for_rails-1.0.1 README.rdoc
avatars_for_rails-1.0.0 README.rdoc