R
Remco Swoany
Hi,
I am a RoR newby. The code below shows the categorie names, in a
dropdown from the categories table and that works fine. But now i want
to show the categories through checkboxen. How can i realise that??
<select name="recipe[categorie_id]">
<% @categories.each do |categorie| %>
<option value="<%= categorie.id %>"
<%= 'selected' if categorie.id == @recipe.categorie_id %>>
<%= categorie.name %>
</option>
<% end %>
</select>
Grtz..remco
I am a RoR newby. The code below shows the categorie names, in a
dropdown from the categories table and that works fine. But now i want
to show the categories through checkboxen. How can i realise that??
<select name="recipe[categorie_id]">
<% @categories.each do |categorie| %>
<option value="<%= categorie.id %>"
<%= 'selected' if categorie.id == @recipe.categorie_id %>>
<%= categorie.name %>
</option>
<% end %>
</select>
Grtz..remco