From 1ea2317ab4e47dd4b2e87a7f462262d231cef489 Mon Sep 17 00:00:00 2001 From: Devin Howard Date: Thu, 14 Feb 2013 22:36:08 -0500 Subject: [PATCH] nicer formatting on savelayout in maps_controller.rb --- app/controllers/maps_controller.rb | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/app/controllers/maps_controller.rb b/app/controllers/maps_controller.rb index cdd9fba4..f6e8fb83 100644 --- a/app/controllers/maps_controller.rb +++ b/app/controllers/maps_controller.rb @@ -148,23 +148,23 @@ class MapsController < ApplicationController # PUT maps/:id/savelayout def savelayout - @map = Map.find(params[:id]) - - if params[:map][:coordinates] - @all = params[:map][:coordinates] - @all = @all.split(',') - @all.each do |topic| - topic = topic.split('/') - @mapping = Mapping.find(topic[0]) - if @mapping + @map = Map.find(params[:id]) + + if params[:map][:coordinates] + @all = params[:map][:coordinates] + @all = @all.split(',') + @all.each do |topic| + topic = topic.split('/') + @mapping = Mapping.find(topic[0]) + if @mapping @mapping.xloc = topic[1] - @mapping.yloc = topic[2] - @mapping.save + @mapping.yloc = topic[2] + @mapping.save end - end - @map.arranged = true - @map.save - end + end + @map.arranged = true + @map.save + end end # GET maps/:id/realtime