Skip to content

Instantly share code, notes, and snippets.

@acidtib
Created September 28, 2012 18:35
Show Gist options
  • Save acidtib/3801431 to your computer and use it in GitHub Desktop.
Save acidtib/3801431 to your computer and use it in GitHub Desktop.
CarrierWave with Device
class Admin < ActiveRecord::Base
# Include default devise modules. Others available are:
# :token_authenticatable, :confirmable,
# :lockable, :timeoutable and :omniauthable
devise :database_authenticatable, :registerable,
:recoverable, :rememberable, :trackable, :validatable
# Setup accessible (or protected) attributes for your model
attr_accessible :email, :password, :password_confirmation, :remember_me, :firstname, :lastname, :username, :nickname, :facebook, :twitter, :linkedin, :phone, :avatar, :avatar_cache, :remove_avatar, :remote_avatar_url
# attr_accessible :title, :body
mount_uploader :avatar, AvatarUploader
end
class Admin < ActiveRecord::Base
mount_uploader :avatar, AvatarUploader
# Include default devise modules. Others available are:
# :token_authenticatable, :confirmable,
# :lockable, :timeoutable and :omniauthable
devise :database_authenticatable, :registerable,
:recoverable, :rememberable, :trackable, :validatable
# Setup accessible (or protected) attributes for your model
attr_accessible :email, :password, :password_confirmation, :remember_me, :firstname, :lastname, :username, :nickname, :facebook, :twitter, :linkedin, :phone, :avatar, :avatar_cache, :remove_avatar, :remote_avatar_url
# attr_accessible :title, :body
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment