2012-05-10 rails3.2 ã§éæ¥ã ã¼ãï¼ï¼¾Ïï¼¾ï¼ï¼ ãã·ãããããè¨ããªãæ¹è¡ã§ããï¼ãããï¼(^o^)ï¼¼ããã¦ã¼ã æ¹è¡ã brã¿ã°ã«å¤æãããã è¶ ç°¡åãããªäºãªã®ã«å¾®å¦ã«è¦æ¦ããã®ã§ã¾ã¨ãã ãããã§ã¯æ å ±ã溢ãããã¦ãããããã説ã¯ä¸è¨ã®äºã¤ æ¡ï¼ æ¹è¡ã³ã¼ããgsubã§brã¿ã°ã«å¤ããããã¼ def br(str) str = html_escape(str) str.gsub(/\r\n|\r|\n/, "<br />") end (ï¼¾qï¼¾)ãããã ã¨ãhtml_safe ã§ãéããªãéãbrã¿ã°ãç¡è¦ããã¦ãã¾ããããªããã (ï½ã»Ïã»Â´)ãã§ãã¦ã¼ã¶ã¼ã®å ¥å㧠html_safe ã¨ã使ãã®ã¯å±éºã ãã æ¡ï¼ãsimple_format ã使ããã def br(str) simple_format(str) end 確ãã« rails ãç¨æãã helpe
{{#tags}}- {{label}}
{{/tags}}