As far as I can tell, Rails does not simplify the issue of the redirect and sets up the body of the response. To do this, you need to manually redirect. For instance.
response.headers['Location'] = request.referer
render :json => params, :status => :moved_permanently
Please note that not all requests contain a referent, so you must specify a return location for redirection. For instance.
response.headers['Location'] = request.referer || '/somewhere'
nickh source
share