Created
December 30, 2013 16:22
-
-
Save cowgill/8184223 to your computer and use it in GitHub Desktop.
Trying to get closure_tree to render a drop down with categories and sub-categories nested. Neither of the two items work.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<%= form_for(@item, html: {class: 'form_auth'}) do |f| %> | |
<% if @item.errors.any? %> | |
<div id="error_explanation"> | |
<h2><%= pluralize(@item.errors.count, "error") %> prohibited this item from being saved:</h2> | |
<ul> | |
<% @item.errors.full_messages.each do |msg| %> | |
<li><%= msg %></li> | |
<% end %> | |
</ul> | |
</div> | |
<% end %> | |
<div class="form-group"> | |
<%= f.label :name %> | |
<%= f.text_field :name, :autofocus => true, class: "form-control" %> | |
</div> | |
<div class="form-group"> | |
<%= f.label :category %> | |
<%= select_tag :category_id, options_for_select(Category.hash_tree) %> | |
<%= f.collection_select(:category_id, Category.hash_tree, :id, :name, {include_blank: "Select one"}, {class: "form-control"}) %> | |
</div> | |
<div class="form-group"> | |
<%= f.label :description %> | |
<%= f.text_area :description, class: "form-control" %> | |
</div> | |
<div class="form-group"> | |
<%= f.label :meta_title %> | |
<%= f.text_field :meta_title, class: "form-control" %> | |
</div> | |
<div class="form-group"> | |
<%= f.label :meta_description %> | |
<%= f.text_area :meta_description, class: "form-control" %> | |
</div> | |
<div class="actions"> | |
<%= f.submit "Submit Item", class: "btn btn-large btn-primary" %> | |
</div> | |
<% end %> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment