nicer formatting on savelayout in maps_controller.rb

This commit is contained in:
Devin Howard 2013-02-14 22:36:08 -05:00
parent 5e051ebff2
commit 1ea2317ab4

View file

@ -148,23 +148,23 @@ class MapsController < ApplicationController
# PUT maps/:id/savelayout # PUT maps/:id/savelayout
def savelayout def savelayout
@map = Map.find(params[:id]) @map = Map.find(params[:id])
if params[:map][:coordinates] if params[:map][:coordinates]
@all = params[:map][:coordinates] @all = params[:map][:coordinates]
@all = @all.split(',') @all = @all.split(',')
@all.each do |topic| @all.each do |topic|
topic = topic.split('/') topic = topic.split('/')
@mapping = Mapping.find(topic[0]) @mapping = Mapping.find(topic[0])
if @mapping if @mapping
@mapping.xloc = topic[1] @mapping.xloc = topic[1]
@mapping.yloc = topic[2] @mapping.yloc = topic[2]
@mapping.save @mapping.save
end end
end end
@map.arranged = true @map.arranged = true
@map.save @map.save
end end
end end
# GET maps/:id/realtime # GET maps/:id/realtime