Description: Using RhoMobile, we can handle the accidental breakage of the layout due to HTML-unsafe characters in view using ERB’s escape_html.
In our controller, we need to include the ERB::Utilmodule and in our view, we need to print values with
<%=html_escape @value %> or the shorthand version <%=h @value %> to ensure that our code is escaped properly, and no accidental breakage happens.
class SampleController < Rho::RhoController
include ERB::Util # Include ERB::Util module to use escape_html function in view In View,
<p>Code: <%=html_escape @code_value %></p>