Created
January 10, 2017 03:19
-
-
Save abelorian/cdbf421f0e3a7787bbdacb2f8b353332 to your computer and use it in GitHub Desktop.
Rails js render
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def autocomplete | |
query = params[:q] | |
@data = SearchService.autocomplete(query) | |
render text: render_to_string(:action => "partials/_autocomplete.html.erb", :layout => false, data: @data) | |
end | |
# $.get( search_autocomplete_url, {q: query}, function(res) { | |
# $("#search-container").html(res); | |
# }) | |
# .fail(function() { | |
# console.log( "error" ); | |
# }); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment