working ember... again

This commit is contained in:
2013-10-07 23:00:01 +02:00
parent a8c01d264e
commit 2f41560591
46 changed files with 274 additions and 114 deletions
@@ -5,9 +5,16 @@ module Suppliers
# GET /sections.json
def index
@sections = current_supplier.sections
@sections.include_relation(:table)
@active_lists = current_supplier.active_lists
@sections.include_relation(:tables)
@active_lists = List.active_for_supplier(current_supplier.id)
@active_table_ids = @active_lists.map(&:table_id).compact
for section in @sections
for table in section.tables
if active_list = @active_lists.find{|l| l.table_id == table.id}
table.active_list = active_list
end
end
end
respond_to do |format|
format.html # index.html.erb