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
|
# 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
|
||||||
|
|
Loading…
Reference in a new issue