I have a model with the following validation:
validates_uniqueness_of :contact_id, :scope => :list_id
The validation works correctly and prevents duplicate records being
created that contain the same contact_id and list_id.
However, I can't get the error message to appear on the submission form.
I have:
<%= error_messages_for 'contact_list' %>
enclosed within the form, but it's only displaying flash[:notice]
messages from the controller.
How do I get to display error messages from the model?
Thanks,
David
--
Posted via http://www.ruby-forum.com/.
enclosed within the form, but it's only displaying flash[:notice]
Hi,
I have a model with the following validation:
validates_uniqueness_of :contact_id, :scope => :list_id
The validation works correctly and prevents duplicate records being
created that contain the same contact_id and list_id.
However, I can't get the error message to appear on the submission form.
I have:
<%= error_messages_for 'contact_list' %>
messages from the controller.
How do I get to display error messages from the model?