[Rails] ActiveRecord Validations Not Working

2012-09-12 Thread honey ruby
Hi all i am learning Rails3.2.7 but by ActiveRecords Validations are not working. These are my User.rb class User ActiveRecord::Base attr_accessible :password, :fullname,:user_name ,:email,:company_name#,:terms_of_service,:password_confirmation validates :terms_of_service,

Re: [Rails] ActiveRecord Validations Not Working

2012-09-12 Thread Gintautas Šimkus
Is the record being saved? If not, then most likely you just do not have infrastructure in place to display the errors. 2012/9/12 honey ruby emailtohoneyr...@gmail.com Hi all i am learning Rails3.2.7 but by ActiveRecords Validations are not working. These are my User.rb class User

Re: [Rails] ActiveRecord Validations Not Working

2012-09-12 Thread hanish jadala
@Gintautas Šimkus when i enter data my data is saving. What do u mean by infrastructure in place to display the errors. On Wed, Sep 12, 2012 at 5:18 PM, Gintautas Šimkus dihita...@gmail.comwrote: Is the record being saved? If not, then most likely you just do not have infrastructure in place

Re: [Rails] ActiveRecord Validations Not Working

2012-09-12 Thread Gintautas Šimkus
OK, what I meant is that maybe you were expecting error to get displayed without actually putting the code (most likely in a layout template), i.e. (the example is in HAML) = render partial 'layouts/errors' and layouts/_errors could look something like %div#errors= flash[:error] But if it is

Re: [Rails] ActiveRecord Validations Not Working

2012-09-12 Thread Colin Law
On 12 September 2012 12:44, honey ruby emailtohoneyr...@gmail.com wrote: Hi all i am learning Rails3.2.7 but by ActiveRecords Validations are not working. These are my User.rb class User ActiveRecord::Base attr_accessible :password, :fullname,:user_name