Cms::FormBuilder.class_eval do attr_reader :template # ensure the related css is included def ensure_css template.content_for :html_head do template.stylesheet_link_tag("bcms_tools.css") end end def remove_check_box() "#{check_box('_destroy')} Remove ?" end def jquery_escape(aString) # from http://samuelsjoberg.com/archive/2009/09/escape-jquery-selectors # return str.replace(/([#;&,\.\+\*\~':"\!\^$\[\]\(\)=>\|])/g, "\\$1"); aString.gsub(/([#;&,\.\+\*\~':"\!\^$\[\]\(\)=>\|])/) {|c| '\\\\'+c} end # standard original file upload # #// # #