I've got an odd case where the certain models doesn't want to either
update and/or create a new one. The problem, as I later found out,
was due to validation errors (which is great, actually) except for
some reason, <%= error_messages_for 'some_model' %> doesn't print
anything. This is problematic, because as it turns out, one of my
user models won't update because I have to provide a new password,
each time.
Long story short, I have two problems:
error_messages_for method doesn't seem to print anything. Does this
have to do with how I'm bringing up the code in my controller? A
typical update method in my controllers look like this:
The second problem is how do I update only portions of the model
(preferably some method that accepts an :except parameter) given by
the text field in the view forms that's supposed to update the model.
I'm currently using the method update_attributes(params[:user]), and I
DON'T want it to update the password if the password field is empty,
which this method seems to be doing.
I forgot to mention that I want the method to update portions of the
Model while, at the same time, passes through the validation filter.
I also realized half the problem also lies on how some parameters are
required in the user model. By using singular update method, do I
have to pass through those validation filters as well?