note avatar

This commit is contained in:
Nico 2013-01-09 18:30:23 +01:00
parent 6947f1aaea
commit dc49719bd2
5 changed files with 11 additions and 6 deletions

View File

@ -98,6 +98,7 @@ GEM
net-ssh (>= 1.99.1)
nokogiri (1.5.6)
orm_adapter (0.4.0)
pg (0.14.1)
polyglot (0.3.3)
posix-spawn (0.3.6)
pygments.rb (0.3.7)
@ -174,6 +175,7 @@ DEPENDENCIES
kaminari
mysql2
nokogiri
pg
pygments.rb
rails (= 3.2.9)
redcarpet

View File

@ -9,8 +9,8 @@ class Admin < ActiveRecord::Base
attr_accessor :login
# Setup accessible (or protected) attributes for your model
attr_accessible :email, :password, :password_confirmation, :remember_me, :username, :name, :firstname
attr_accessible :email, :password, :password_confirmation, :remember_me, :username, :name, :firstname, :file
# attr_accessible :title, :body
mount_uploader :file, AvatarUploader
end

View File

@ -30,6 +30,11 @@
%td.label= f.label :password_confirmation, "Confirmation :"
%td= f.text_field :password_confirmation, :class => "inputText"
%tr
%td.label= f.label :file,"image :"
%td
= f.file_field :file
=image_tag(f.object.file.large.thumb.url) if f.object.file
.actions

View File

@ -4,8 +4,7 @@
.left
.user
=gravatar_image_tag(note.admin.email, :class => "avatar", :gravatar => {:default => "http://#{HOSTNAME}/assets/default_avatar.jpg"})
=image_tag (note.admin.file? ? note.admin.file.large.thumb.url : ""), :class => "avatar"
=note.admin.username
.date=l note.created_at, :format => :short

View File

@ -10,7 +10,6 @@ development:
database: pic_vert
pool: 5
username: root
password: dev
socket: /tmp/mysql.sock