How to add an anchor to redirect_to :back
Deep in Rails redirecting mechanism, :back
simply means redirect to whatever in HTTP_REFERER
environment variable (or raise an error if nothing in this variable). So before redirect_to :back
in your controller add this line: env["HTTP_REFERER"] += '#some-id'
, this should do it.