I have some ajax that uses the following action.
def game_type
if params[:game_type] == "team"
@game_for = "Team"
@match_partial = "team_match_fields.html.erb"
else
@game_for = "Player"
@match_partial = "player_match_fields.html.erb"
end
respond_to do |format|
format.js { @game_for }
end
end
If I use just one variable in the respond_to block, things are fine, but I want to be able to pass both @game_for and @match_partial to my js file. How can I do that? I haven't found a good explanation of syntax for using respond_to.