Railsã§sanitizeãstrip_tagsã¨ãã£ãã¡ã½ãããåå¨ãããããã¥ã¼ã®ãã«ãã¼ã¨ãã¦å®ç¾©ããã¦ããã®ã§ãã©ãã§ã使ãããã®ã§ã¯ãªãã ãããã³ã³ããã¼ã©ã¼ãã¢ãã«ã®ä¸ã§ä½ã¨ããã¦ä½¿ããã¨ãã§ããããã ããåçã®æ©è½ãæä¾ããSanitizeã¨ããgemãããã®ã§ãã¡ãã使ã£ãæ¹ã楽ã ã å°å ¥ gemã§å ¥ããã gem install sanitize 使ãæ¹ ãã¹ã¦ã®ã¿ã°ãåé¤ãã Sanitize.clean(html_string)ã§html_stringå ã®ã¿ã°ãåé¤ããã irbã§è©¦ãã¦ã¿ãã :001 > require 'sanitize' => true :002 > html_string = "<h1>hello clean world</h1>" => "<h1>hello clean world</h1>" :003 > Sanitize.clean
{{#tags}}- {{label}}
{{/tags}}