Created
October 8, 2009 13:57
-
-
Save christianhager/205036 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
in account model: | |
accepts_nested_attributes_for :from_adrs, :allow_destroy => true | |
in from_adr model: | |
validates_format_of :email, | |
:with => /^([^@\s]+)@((?:[-a-z0-9]+\.)+[a-z]{2,})$/i, | |
:message => 'email must be valid' | |
form: | |
<%form_for @account do |f|%> | |
<%=f.error_messages%> | |
<%f.fields_for :from_adrs do |f2|%> | |
<%=f2.text_field :email%> | |
<%end%> | |
<%=f.submit "Save"%> | |
<%end%> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment