Forum: Ruby on Rails How to allow email blank in user table which is created using devise and cancan.

0c22cc317d52edd6339897efa85ed7fa?d=identicon&s=25 Tushar Patil (Guest)
on 2013-08-07 10:20
(Received via mailing list)
I have a *user mode*l in  which *username* and* email* field, i am login
with username  when i am creating user i want it's email may be blank,
but
when i am register user from another model it gives error *User email
can't
be blank*.
I already make changes email field in confgi/devise.rb, but it doesn't
work.

Here is My *User model*

*class User < ActiveRecord::Base*

  has_and_belongs_to_many :roles

  devise :database_authenticatable, :registerable, :rememberable,
:token_authenticatable, :trackable,
         :validatable, :timeoutable ,:lockable, :recoverable ,
:authentication_keys => [:username]

  attr_accessible :email, :username, :password, :password_confirmation,
:remember_me, :role_ids, :roles
  validates :email , :presence => false
*end*
Please, let me know where i am wrong.

Thanks,
Tushar Patil.
28ae21f3828c4fa72370b00edc44364d?d=identicon&s=25 Sushil Damdhere (Guest)
on 2013-08-07 17:57
(Received via mailing list)
Please log in before posting. Registration is free and takes only a minute.
Existing account

NEW: Do you have a Google/GoogleMail, Yahoo or Facebook account? No registration required!
Log in with Google account | Log in with Yahoo account | Log in with Facebook account
No account? Register here.