app/models/service_learning/service_learning_position.rb
# Uses Rails' sanitize method to remove all HTML tags from all inputs except for the following tags:
# +p, br, strong, em, b, i, ol, ul, li, a, img+
# 
# Also removes any IE conditional crap like +<!--[if+ and all that.
Uses Rails' sanitize method to remove all HTML tags from all inputs except for the following tags.

Also removes any IE conditional crap like +<!--[if+ and all that.
Uses Rails ' sanitize method to remove all HTML tags from all inputs except for the following tags . Also removes any IE conditional crap like + <! -- [ if + and all that .
def sanitize_user_input
    self.attributes.each do |name, value|
      if value.is_a?(String)
        value = ActionController::Base.helpers.sanitize(value, :tags => %w(strong em b i ol ul li a img p br))
        value = value.gsub("<p>&nbsp;</p>", "")
        value = value.gsub(/\[if(.*)\[endif\]/, "")
        value = value.strip
        self.write_attribute(name, value)
      end
    end
  end
def sanitize_user_input self . attributes . each do | name , value | if value . is_a? ( String ) value = ActionController :: Base . helpers . sanitize ( value , :tags => %w( strong em b i ol ul li a img p br ) ) value = value . gsub ( "<p>&nbsp;</p>" , "" ) value = value . gsub ( / \[ if(.*) \[ endif \] / , "" ) value = value . strip self . write_attribute ( name , value ) end end end
Uses Rails' sanitize method to remove all HTML tags from all inputs except for the following tags:
+p, br, strong, em, b, i, ol, ul, li, a, img+
Uses Rails ' sanitize method to remove all HTML tags from all inputs except for the following tags : + p br strong em b i ol ul li a img +