1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30
|
@contacts = Contact.find(:all)
<%= form_remote_tag( :url => {:action => 'ajout_contact', :id => @personne } ) %>
<table>
<tr>
<td><%= label_for ="Contact" %></td>
<td>
<select name="personneContact[contact_id]">
<% @contacts.each do |c| %>
<option value="<%= c.id %>">
<%=h Contact.find(c.id).nom%>
<%=h Contact.find(c.id).prenom%>
</option>
<% end %>
</select>
</td>
</tr>
<tr>
<td><%= label_for ="Date" %><br /></td>
<td><%= date_select('personneContacts', 'date',
:end_year => Date.current.year,
:include_blank => true,
:order => [:day, :month, :year])%>
</td>
</tr>
</table>
<%= submit_tag 'Enregistrer' %>
<%$end%> |
Partager