Skip to content

Commit

Permalink
feat(Add category drop-down menu
Browse files Browse the repository at this point in the history
  • Loading branch information
chiefkikio committed Jul 16, 2018
1 parent 3ac6f77 commit 83d3d27
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion app/views/items/_form.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,12 @@

<%= f.input :category, label: "Category", wrapper: :vertical_input_group do %>
<span class="input-group-addon"><i class="fa fa-cubes"></i></span>
<%= f.input_field :category, class: "form-control" %>
<%= f.input_field :category, class: "form-control", list:"category" %>
<datalist id="category">
<%- Item.all.map(&:category).uniq.each do |category| %>
<option><%= category %></option>
<% end %>
</datalist>
<% end %>

<%= f.button :submit, class:"btn btn-info"%>
Expand Down

0 comments on commit 83d3d27

Please sign in to comment.