changed maps controller so it accepts synapses as a csv list

This commit is contained in:
Devin Howard 2013-01-07 22:04:53 -05:00
parent 647467e97a
commit e481dcd822

View file

@ -74,6 +74,20 @@ class MapsController < ApplicationController
@mapping.yloc = topic[2] @mapping.yloc = topic[2]
@mapping.save @mapping.save
end end
if params[:map][:synapsesToMap]
@synAll = params[:map][:synapsesToMap]
@synAll = @synAll.split(',')
@synAll.each do |synapse|
@mapping = Mapping.new()
@mapping.category = "Synapse"
@mapping.user = @user
@mapping.map = @map
@mapping.synapse = Synapse.find(synapse[0])
@mapping.save
end
end
@map.arranged = true @map.arranged = true
@map.save @map.save
respond_to do |format| respond_to do |format|