En ce moment :Genshin Impact, Valhalla, Breath of the wild, Animal Crossing, GTA 5, Red dead 2
PCPS5Xbox SeriesSwitch 2
Liste des sujets
problème html/rails
NOBOWDY
Niveau 10
11 avril 2016 à 17:18:00
bonsoir, j'ai un probleme avec bootstrap/html
<%@channel.each do |c|%>
<code><li class="list-group-item list-group-item-success clearfix">
<h4 class="list-group-item-heading"><%=c.nom%>
<form action="/messages/rejoindre" method="post"><span class="pull-right button-group"><button type="submit" class="btn btn-info"><span class="glyphicon glyphicon-ok"></span> Rejoindre</button></span></form>
</h4>
<p class="list-group-item-text"><%=c.userpresentid.count%> personne(s) dans ce channel</p>
</li>
<%end%>
Enfaite j'aimerai pouvoir recuperer l'id channel <%= c.id %> choisis dans ma fonction rejoindre de mon controller. mais comme vous pouvez le voir pour l'instant cette forme ne renvoie rien. Merci
Krominion
Niveau 4
12 avril 2016 à 04:02:29
Ajoute un hidden field dans ton formulaire, exemple: <% hidden_field_tag 'channel_id', c.id %> et tu récupère dans ton controller avec params[:channel_id]
Krominion
Niveau 4
12 avril 2016 à 04:20:05
Mettre dans <%= et non juste <%, petite erreur de ma part.