2012å¹´9æ17æ¥æææ¥ Rails 3 autolink(ããã¹ããã¼ã¿å ã®URLãèªåã§ãªã³ã¯ã«ãã)ã¯ç°¡åä¾¿å© Railsã§ããã¹ãå ã«ããRULãèªåçã«ãªã³ã¯ã«å¤æãããã«ãã¼ã§ããRails3.1ã®ã¨ãã«åãé¢ãããããã§ãã ãã ãä»åã¯å°æ¥çã«ã«ã¹ã¿ãã¤ãºãããã£ãã®ã§ãèªä½ããæ¹æ³ãæ¢ãã¦è¦ã¤ãã¾ãããæã£ãããç°¡åã§ããã§ãããã£ãããã©ã¤ãã¦ã¿ã¦ãã ããã¾ãã require 'uri' def auto_link(html_string,options={}) target = options[:target] || '_blank' URI.extract(html_string).uniq.each{|url| html_string.gsub!(url,"#{url}") } html_string end åèã«ããã¦é ãããµã¤ãï¼ ããã¹ããã¼ã¿å ã®UR
{{#tags}}- {{label}}
{{/tags}}