tilzinger
unread,Dec 5, 2008, 4:58:25 PM12/5/08Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to attribute_fu
Everything is working for me now attribute_fu, except for when I go to
edit a record (in this case a 'contact') it doesn't set the select
list for my list of email attributes (each contact can have multiple
email addresses). Each email address has a type (work, personal etc),
and the problem is that the @contact.email_addresses value that was
already saved is not used to set the selection on the select list when
editing contact. How do I get the type of email address that is saved
with the record to set the selection on the list? Thanks
_contact_category_group.html.erb
<div id="email_addresses">
<h4>Email Addresses</h4>
<div class="add_new"><%= f.add_associated_link "Add",
EmailAddress.new, :partial => 'shared/email_address' %></div>
<%= f.render_associated_form @contact.email_addresses, :new =>
1, :partial => 'shared/email_address' %>
</div>
_email_address.html.erb
<div class="email_address">
<%= f.text_field "value" %>
<%= f.select "category", ContactCategory.get_category
("email_address").collect {|p| [[p.label], [p.short]]} %>
<%= f.remove_link "remove" %>
</div>