title: Rails how to allways gsub column before save?
body: <p>I am trying to make gsub on my column before save or update.</p>
  
  <p>Here is my controller:</p>
  
  <pre><code>        def dansk(text)
      self.text.gsub('å', '&amp;aring;')
      self.text.gsub('Å', '&amp;Aring;')
      self.text.gsub('æ', '&amp;aelig;')
      self.text.gsub('Æ', '&amp;AElig;')
      self.text.gsub('ø', '&amp;oslash;')
      self.text.gsub('Ø', '&amp;Oslash;')
      end
  
  def update  
  
          @photographer = Photographer.find(params[:id])          
          @photographer.update_attributes(params[:photographer])
          @photographer.text = dansk(params[:photographer][:text])
              @photographer.text = dansk(params[:photographer][:name])
  
  
                         !@photographer.save                              
              flash[:notice] = "&amp;nbsp;"
              render_action 'edit'            
  
  
      end
  </code></pre>
  
  <p>What are I am doing wrong and why are the text and name not being "gsubbed" ? </p>
  
  <p><strong>UPDATE:</strong>
  My helper:</p>
  
  <pre><code>def convert_html_entities(text)
      text.gsub(/&amp;aring;/,"å")
      text.gsub(/&amp;aelig;/,"æ")
      text.gsub(/&amp;oslash;/,"ø")   
      text.gsub(/&amp;copy;/,"©")
      text = text.gsub(/["]/, '&amp;quot;')       
  end 
  </code></pre>