json response was broken
This commit is contained in:
parent
7e7ef173e5
commit
a295c61322
2 changed files with 7 additions and 6 deletions
|
@ -13,7 +13,7 @@ class MainController < ApplicationController
|
|||
@maps = policy_scope(Map).order("updated_at DESC").page(1).per(20)
|
||||
respond_to do |format|
|
||||
format.html {
|
||||
if authenticated?
|
||||
if not authenticated?
|
||||
render 'main/home'
|
||||
else
|
||||
render 'maps/activemaps'
|
||||
|
|
|
@ -13,11 +13,12 @@ class MapsController < ApplicationController
|
|||
@maps = policy_scope(Map).order("updated_at DESC")
|
||||
.page(page).per(20)
|
||||
|
||||
# root url => main/home. main/home renders maps/activemaps view.
|
||||
redirect_to root_url and return if authenticated?
|
||||
|
||||
respond_to do |format|
|
||||
format.html { respond_with(@maps, @user) }
|
||||
format.html {
|
||||
# root url => main/home. main/home renders maps/activemaps view.
|
||||
redirect_to root_url and return if authenticated?
|
||||
respond_with(@maps, @user)
|
||||
}
|
||||
format.json { render json: @maps }
|
||||
end
|
||||
end
|
||||
|
@ -81,7 +82,7 @@ class MapsController < ApplicationController
|
|||
|
||||
respond_with(@allmappers, @allmappings, @allsynapses, @alltopics, @map)
|
||||
}
|
||||
format.json { render json: @map.as_json }
|
||||
format.json { render json: @map }
|
||||
end
|
||||
end
|
||||
|
||||
|
|
Loading…
Reference in a new issue