fix develop branch bugs (#679)
* bugfix - rename SearchController so it works * remove unneeded respond_with * fix to_json calls
This commit is contained in:
parent
9605b24640
commit
db3cf0490f
2 changed files with 5 additions and 8 deletions
|
@ -19,9 +19,6 @@ class MapsController < ApplicationController
|
||||||
@allmappings = policy_scope(@map.mappings)
|
@allmappings = policy_scope(@map.mappings)
|
||||||
@allmessages = @map.messages.sort_by(&:created_at)
|
@allmessages = @map.messages.sort_by(&:created_at)
|
||||||
@allstars = @map.stars
|
@allstars = @map.stars
|
||||||
|
|
||||||
respond_with(@allmappers, @allcollaborators, @allmappings, @allsynapses,
|
|
||||||
@alltopics, @allmessages, @allstars, @map)
|
|
||||||
end
|
end
|
||||||
format.json { render json: @map }
|
format.json { render json: @map }
|
||||||
format.csv { redirect_to action: :export, format: :csv }
|
format.csv { redirect_to action: :export, format: :csv }
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
# frozen_string_literal: true
|
# frozen_string_literal: true
|
||||||
class MainController < ApplicationController
|
class SearchController < ApplicationController
|
||||||
include TopicsHelper
|
include TopicsHelper
|
||||||
include MapsHelper
|
include MapsHelper
|
||||||
include UsersHelper
|
include UsersHelper
|
||||||
|
@ -73,7 +73,7 @@ class MainController < ApplicationController
|
||||||
@topics = []
|
@topics = []
|
||||||
end
|
end
|
||||||
|
|
||||||
render json: autocomplete_array_json(@topics)
|
render json: autocomplete_array_json(@topics).to_json
|
||||||
end
|
end
|
||||||
|
|
||||||
# get /search/maps?term=SOMETERM
|
# get /search/maps?term=SOMETERM
|
||||||
|
@ -107,7 +107,7 @@ class MainController < ApplicationController
|
||||||
@maps = []
|
@maps = []
|
||||||
end
|
end
|
||||||
|
|
||||||
render json: autocomplete_map_array_json(@maps)
|
render json: autocomplete_map_array_json(@maps).to_json
|
||||||
end
|
end
|
||||||
|
|
||||||
# get /search/mappers?term=SOMETERM
|
# get /search/mappers?term=SOMETERM
|
||||||
|
@ -125,7 +125,7 @@ class MainController < ApplicationController
|
||||||
else
|
else
|
||||||
@mappers = []
|
@mappers = []
|
||||||
end
|
end
|
||||||
render json: autocomplete_user_array_json(@mappers)
|
render json: autocomplete_user_array_json(@mappers).to_json
|
||||||
end
|
end
|
||||||
|
|
||||||
# get /search/synapses?term=SOMETERM OR
|
# get /search/synapses?term=SOMETERM OR
|
||||||
|
@ -151,7 +151,7 @@ class MainController < ApplicationController
|
||||||
# limit to 5 results
|
# limit to 5 results
|
||||||
@synapses = @synapses.to_a.slice(0, 5)
|
@synapses = @synapses.to_a.slice(0, 5)
|
||||||
|
|
||||||
render json: autocomplete_synapse_array_json(@synapses)
|
render json: autocomplete_synapse_array_json(@synapses).to_json
|
||||||
end
|
end
|
||||||
|
|
||||||
private
|
private
|
||||||
|
|
Loading…
Reference in a new issue