nicer formatting on savelayout in maps_controller.rb
This commit is contained in:
parent
5e051ebff2
commit
1ea2317ab4
1 changed files with 15 additions and 15 deletions
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue