No commit activity in last 3 years
No release in over 3 years
There's a lot of open issues
A Rails engine that allows any model to act as avatarable, permitting it to have a complete avatar manager
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

~> 0.3.9
~> 1.3.2
~> 0.3.6
>= 3.1.0
>= 2.5.0

Runtime

~> 0.0.1
>= 3.0.0
>= 2.3.4
>= 2.13.1
 Project Readme

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 user 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 user 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: 'avatars/form',
           object: @user,
           as: :avatarable %>

You must include the javascript and css files

//= require avatars_for_rails

If you want to get an user’s avatar you can do:

user.logo

For rendering an image_tag for an user’s avatar:

<%= image_tag(user.logo.url(:style) ) %>