raw defined as an assistant in the actionpack / action_view library, so without rails you cannot use it. But ERB templating shows its output without any output:
require 'erb' @person_name = "<script>name</script>" ERB.new("<%= @person_name %>").result
And because of this, there is an ERB::Util#html_escape method to escape
include ERB::Util ERB.new("<%= h @person_name %>").result
source share