search for: all_values_are_blank

Displaying 1 result from an estimated 1 matches for "all_values_are_blank".

2006 Nov 05
0
Forms with associations and collections
...ddress for the Property.address. 2. If the Address fields are blank the Address record will still be created. 3. So, I use a custom function to test each value of the hash and return true if all are blank - only add if false... (i.e. @property.build_address(params[:address]) unless params[:address].all_values_are_blank?) 4. If I am updating the property rather than creating it I have to test whether the address is nil and either update, create or delete depending on what has been passed in params. Seems a bit messy and rails always seems to have an elegant solution for this standard sort of stuff so I am sure I...