fix @maps serialization bug
if @maps is empty, it returns {"maps":[]}, instead of [] like we expect on the frontend. This commit fixes this issue
This commit is contained in:
parent
eef8a281cb
commit
df84bd9e1d
1 changed files with 6 additions and 6 deletions
|
@ -19,7 +19,7 @@ class MapsController < ApplicationController
|
||||||
redirect_to(root_url) && return if authenticated?
|
redirect_to(root_url) && return if authenticated?
|
||||||
respond_with(@maps, @user)
|
respond_with(@maps, @user)
|
||||||
end
|
end
|
||||||
format.json { render json: @maps }
|
format.json { render json: @maps.to_json }
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -33,7 +33,7 @@ class MapsController < ApplicationController
|
||||||
|
|
||||||
respond_to do |format|
|
respond_to do |format|
|
||||||
format.html { respond_with(@maps, @user) }
|
format.html { respond_with(@maps, @user) }
|
||||||
format.json { render json: @maps }
|
format.json { render json: @maps.to_json }
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -51,7 +51,7 @@ class MapsController < ApplicationController
|
||||||
|
|
||||||
respond_to do |format|
|
respond_to do |format|
|
||||||
format.html { respond_with(@maps, @user) }
|
format.html { respond_with(@maps, @user) }
|
||||||
format.json { render json: @maps }
|
format.json { render json: @maps.to_json }
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -69,7 +69,7 @@ class MapsController < ApplicationController
|
||||||
|
|
||||||
respond_to do |format|
|
respond_to do |format|
|
||||||
format.html { respond_with(@maps, @user) }
|
format.html { respond_with(@maps, @user) }
|
||||||
format.json { render json: @maps }
|
format.json { render json: @maps.to_json }
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -88,7 +88,7 @@ class MapsController < ApplicationController
|
||||||
|
|
||||||
respond_to do |format|
|
respond_to do |format|
|
||||||
format.html { respond_with(@maps, @user) }
|
format.html { respond_with(@maps, @user) }
|
||||||
format.json { render json: @maps }
|
format.json { render json: @maps.to_json }
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -101,7 +101,7 @@ class MapsController < ApplicationController
|
||||||
|
|
||||||
respond_to do |format|
|
respond_to do |format|
|
||||||
format.html { respond_with(@maps, @user) }
|
format.html { respond_with(@maps, @user) }
|
||||||
format.json { render json: @maps }
|
format.json { render json: @maps.to_json }
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue