revert search controller and some topic methods
This commit is contained in:
parent
ae855f6053
commit
412e78dc1a
2 changed files with 6 additions and 6 deletions
|
@ -73,7 +73,7 @@ class SearchController < ApplicationController
|
||||||
@topics = []
|
@topics = []
|
||||||
end
|
end
|
||||||
|
|
||||||
render json: autocomplete_array_json(@topics).as_json
|
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 SearchController < ApplicationController
|
||||||
@maps = []
|
@maps = []
|
||||||
end
|
end
|
||||||
|
|
||||||
render json: autocomplete_map_array_json(@maps).as_json
|
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 SearchController < ApplicationController
|
||||||
else
|
else
|
||||||
@mappers = []
|
@mappers = []
|
||||||
end
|
end
|
||||||
render json: autocomplete_user_array_json(@mappers).as_json
|
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 SearchController < 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).as_json
|
render json: autocomplete_synapse_array_json(@synapses).to_json
|
||||||
end
|
end
|
||||||
|
|
||||||
private
|
private
|
||||||
|
|
|
@ -22,7 +22,7 @@ class TopicsController < ApplicationController
|
||||||
end
|
end
|
||||||
@all= @topics.to_a.concat(@maps.to_a).sort { |a, b| a.name <=> b.name }
|
@all= @topics.to_a.concat(@maps.to_a).sort { |a, b| a.name <=> b.name }
|
||||||
|
|
||||||
render json: autocomplete_array_json(@all).as_json
|
render json: autocomplete_array_json(@all).to_json
|
||||||
end
|
end
|
||||||
|
|
||||||
# GET topics/:id
|
# GET topics/:id
|
||||||
|
@ -39,7 +39,7 @@ class TopicsController < ApplicationController
|
||||||
|
|
||||||
respond_with(@allsynapses, @alltopics, @allcreators, @topic)
|
respond_with(@allsynapses, @alltopics, @allcreators, @topic)
|
||||||
end
|
end
|
||||||
format.json { render json: @topic.as_json(user: current_user) }
|
format.json { render json: @topic.as_json(user: current_user).to_json }
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue