After troubleshooting a simple GET request to the controller action, I confirmed that the request is being made successfully and there are no issues with the controller executing the action. However, I am not receiving any response data.
$.ajax({
url: _url,
type: 'GET',
dataType: 'json',
sucess: function(response) {
alert(response);
console.log("response: " + response);
}
});
def get_team_statuses
@wager = Wager.find(params[:id])
_team_count = helpers.get_team_member_names_without_self(@wager).count + 1
_opponent_count = helpers.get_opposing_member_names(@wager).count
_team_full = _team_count == @wager.team_size.players_count
_opposing_team_full = _opponent_count == @wager.team_size.players_count
respond_to do |format|
format.html
format.json { render json: {team_full: _team_full, opposing_team_full: _opposing_team_full } }
end
end
Despite reviewing various resources and documentation suggesting everything is set up correctly, the only notable message received is:
Started GET "/wagers/1b4b6da7-7dd0-4a42-b17b-3872850d908d/get-team-statuses" for ::1 at 2020-08-10 16:11:01 -0700 Processing by WagersController#get_team_statuses as JSON
[active_model_serializers] Rendered ActiveModel::Serializer::Null with Hash (0.09ms)
Completed 200 OK in 12ms (Views: 0.5ms | ActiveRecord: 2.0ms)
Any suggestions or insights?
Edit: Here's what my network tab displays for XHR requests. It shows the multiple request instances when the button was clicked three times.