Sha256: 26715a3a333835888247383535acc0f587f41b1b1f9969d630268805a32cfd30

Contents?: true

Size: 899 Bytes

Versions: 2

Compression:

Stored size: 899 Bytes

Contents

<h2><%%= t(:treeview, :default => 'Treeview') %> <%%= t(:<%= singular_table_name %>, :default => "<%= singular_table_name %>") %></h2>

<div id="treeview">
  <ul>
    <%% <%= model_camelize %>.transaction do %>
    <%% ar = <%= model_camelize %>.where(:<%= model %>_id => nil) %>
    <%% ar = ar.order("position") if <%= model_camelize %>.column_names.include?("position") %>
      <%% for g in ar.all %>
        <%%= build_treeview(g, '<%= model_pluralize %>') %>
      <%% end %>
    <%% end %>
  </ul>
</div>

<%%
 plural_model_name = "<%= model_pluralize %>"
 model_name        = "<%= singular_table_name %>"
 opened_node       = <%= model_camelize %>.select(:id).all.map{ |g| '"treeelt_' + g.id.to_s + '"' }.join(',').html_safe
%>

<%%= render :partial => "layouts/treeview_js", :locals => { :model_name => model_name, :plural_model_name => plural_model_name, :opened_node => opened_node } %>

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
beautiful_scaffold-0.2.4 lib/generators/templates/app/views/treeview.html.erb
beautiful_scaffold-0.2.3 lib/generators/templates/app/views/treeview.html.erb