search for: validates_presence

Displaying 5 results from an estimated 5 matches for "validates_presence".

2007 Jun 10
2
custom errors for validates_presence, etc..
I am trying to figure out how to customize the error messages when I use validates_presence_of. I am validating a user name and I use <%= error_messages_for ''user'' %> in my view to display the messages. I know you can customize in the model with :message =>''custom message'', but I am trying to get rid of the first part of the error message whi...
2006 Jul 21
0
Ajax page.replace_html model validation errors
I have the following setup: A model: that validates using helpers like: validates_presence_of, etc.. A view: called ''new'' which renders a partial The partial: _form which has error_messages_for and a form_remote_tag , submit_tag and end_form_tag An action ''create'': that gets executed via the submit_tag in the _form and which in case it can'&...
2006 Jul 24
0
Ajax page.replace_html model validation render partial errors
Hi; I have the following setup: A model: that validates using helpers like: validates_presence_of, etc.. A view: called ''new'' which renders a partial The partial: _form which has error_messages_for and a form_remote_tag , submit_tag and end_form_tag An action ''create'': that gets executed via the submit_tag in the _form and which in case it can''...
2007 Oct 19
27
Assumption tests
...a behaviour specification (not specifying our own code, outcome driven) - but instead what I''m currently calling an "assumption test". I feel that these should be formalised, because writing somethiing like: it ?should validate_presence_of digits? do PhoneNumber.expects(:validates_presence_of).with(:digits) load ?#{RAILS_ROOT}/app/models/phone_number.rb? end is only meaningful as a specification if you assume that "validates_presence of :digits" is the right syntax to use. So therefore, it is based on an assumption about ActiveRecord, that should be explicitly tes...
2006 Jul 17
19
updating model
hello, i am writing a simple user login system. when registering a user account, i have two field: password password_confirmation which are validated using validates_presence_of validates_confirmation_of and these are then used to generate a password hash which is stored in my database when i want to update the record (without changing the password and entering new values for password and password_confirmation), using the update_attributes method, i am getting erro...