configuring mod_proxy_html properly?

Maybe a bit of a simplistic answer, but most (if not all) ProxyHTMLURLMap directives I've seen so far have a / at the beginning of the match/replace pattern. Have you tried this variant of your configuration?

ProxyHTMLURLMap /railsappname/ /apphost/railsappname/

If that does not help, what version of apache are you running? And if applicable, which version of the module? It only comes bundled with apache since apache 2.4, so for older versions of apache you must have installed (some version of) this module yourself.

As an alternative you can also switch to mod_substitute, although that requires more configuration than mod_proxy_html.

At some point, they removed some built-in configuration, which requires you to add it yourself. See http://apache.webthing.com/svn/apache/filters/proxy_html/proxy_html.conf, the ProxyHTMLLinks and ProxyHTMLEvents directives are the ones you need to add to your config.