Forum: Rails France formulaire à remplir

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
nihed mbarek (Guest)
on 2009-05-25 19:45
(Received via mailing list)
Bonjour, j'ai un formulaire à mettre en place composé de deux champs
(attributs controle_id et risque_id)


<% form_for(@risque_has_controle)  do |f| %>

<p>
    <%= f.label :fluxRevenu %><br />
    <%= select("risque_has_controle","controle_id",@controles.map {|u|
[u.idcontrole,u.id]}) %>
  </p>
  <p>
    <%= f.submit "Create" %>
  </p>
<% end %>

Je voudrais définir le risque_id avec la valeur de @risque.id qui existe
dans la page pour ce formulaire.
C'est mon premier projet personnel sur rails :) Rock

Merci er bonne journée

--
M'BAREK Med Nihed,
Analyst Revenue Assurance Tunisie Telecom
http://www.nihed.com
Fedora Ambassador, TUNISIA, Northern Africa
PUB   1024D/9E2FFB76 Date 2009/02/14
guillaume belleguic (Guest)
on 2009-05-25 20:01
(Received via mailing list)
bonjour,

<%= f.hidden_field :risque_id, :value => @risque.id %>et aussi
<%= f.collection_select :controle_id, @controles, :id, :idcontrole%>

2009/5/25 nihed mbarek <removed_email_address@domain.invalid>
nihed mbarek (Guest)
on 2009-05-25 20:03
(Received via mailing list)
merci

2009/5/25 guillaume belleguic <removed_email_address@domain.invalid>

>>
>> <% end %>
>> http://www.nihed.com
>> Fedora Ambassador, TUNISIA, Northern Africa
>> PUB   1024D/9E2FFB76 Date 2009/02/14
>>
>>
>>
>
> >
>


--
M'BAREK Med Nihed,
Analyst Revenue Assurance Tunisie Telecom
http://www.nihed.com
Fedora Ambassador, TUNISIA, Northern Africa
PUB   1024D/9E2FFB76 Date 2009/02/14
This topic is locked and can not be replied to.