DRYed up app.rb with render_erb helper to check if the request is XHR