Ruby on Rails' respond_to causing strange error
问题 There is another respond_to for the usual case, and a special case when a param[:top] is passed in, so there is another respond_to earlier in the code: respond_to do |format| format.html { render :top_page_analytics } format.json { render :json => @analytics } format.xml { render :xml => @analytics } return end but the above code actually gave a strange error for missing template for json, and further debug leading to: respond_to do |format| format.html { render :top_page_analytics } format