Skip to content

Instantly share code, notes, and snippets.

@zenlor
Created June 15, 2011 09:09
Show Gist options
  • Select an option

  • Save zenlor/1026764 to your computer and use it in GitHub Desktop.

Select an option

Save zenlor/1026764 to your computer and use it in GitHub Desktop.
<% taxons.each do |t| -%>
<% if t.class == Array -%>
<%= partial "taxonomy/chooser", :locals => { :f => f, :taxons => t } %>
<% else -%>
<span style="margin-left: <%= 15*t.depth %>px">&nbsp;</span>
<input type='checkbox' name="taxonomy[]" value="<%= t.id %>" <%= tax_checked?(t.id, f.object.taxonomy) %> ><%= t.title %><br>
<% end -%>
<% end -%>
@page.taxonomy = params[:taxonomy].map { |t|
Taxonomy.find(t)
}
if @page.save
...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment