I have this controller
def search
@filteredusers = User.search(params[:textcontent])
render :json => @filteredusers, :status => :ok
end
that gets data from this Jquery
$( document ).ready(function() {
$('#boton').click(function() {
var searchtext = $('#searchfield').val();
$.post('search', {textcontent:searchtext}, null, "script");
});
});
And then this script which should print the results in the view. But it doesnt. However, I get correct results when I look at the Response in the browser inspector.
$("<%= escape_javascript(render @filteredusers) %>").appendTo("#feedback");