how to substitute underscore of a string in haml <p>I use rails_admin</p> <p>One of my partial is like this :</p> <pre><code>%b= questionnaire.title - CSV.parse(questionnaire.content, :headers =&gt; true, :col_sep =&gt; ",") do |row| - row.to_hash.each do |key, value| = succeed value do %b= key + " : " </code></pre> <p>but key is sometimes like this "I_dont_want_underscore"</p> <p>I tried this :</p> <pre><code> %b= questionnaire.title - CSV.parse(questionnaire.content, :headers =&gt; true, :col_sep =&gt; ",") do |row| - row.to_hash.each do |key, value| = succeed value do %b= key.gsub!-'_',' ') + " : " </code></pre> <p>but then I've got this error showing : Can't convert frozen string (or something like this) Then I tried to duplicate</p> <pre><code>%b= questionnaire.title - CSV.parse(questionnaire.content, :headers =&gt; true, :col_sep =&gt; ",") do |row| - row.to_hash.each do |key, value| = succeed value do %b= key.dup.gsub!-'_',' ') + " : " </code></pre> <p>But then server does not respond anymore...how come ? finally I tried to put a def in my application_helper.rb</p> <pre><code>def sub_underscore self.dup.gsub!-'_',' ') end </code></pre> <p>and</p> <pre><code>%b= questionnaire.title - CSV.parse(questionnaire.content, :headers =&gt; true, :col_sep =&gt; ",") do |row| - row.to_hash.each do |key, value| = succeed value do %b= key.sub_underscore + " : " </code></pre> <p>But I get this error : "no method sub_underscore for this string"</p> <p>Any ideas ?</p>