working ember... again
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user