but when i click Submit button with out entering the data my validations are not working i’m not getting errors messages which is default in rails.Can any one tell where did i go wrong
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 (incorrectly) saving, then the above is not the case.
but when i click Submit button with out entering the data my validations are
not working i'm not getting errors messages which is default in rails.Can
any one tell where did i go wrong
If the code you have posted for the model is not copied/pasted then
please do that (so we can check for typos), also post the code for the
controller action run when you click submit (just that action will
do), and also post the section of development.log for when you clck
submit (look at the log before you click submit to see where to start
the copy/paste from).
Maybe better to have a look at the Rails Guide on debugging first
though to find out how to debug the code, then see if you can work it
out for yourself.
For this : - First remove the # after :company_name.
For :password_confirmation, you should also add :-
attr_accessor :password_confirmation. (because it is not going to be saved in db.)
Hope this helps .