Comments on: converting all newline characters to br tag
/2006/08/07/converting-all-newline-characters-to-br-tag/
Exploring RubyOnRailsFri, 09 Nov 2007 00:21:19 +0000#/?v=2.0.5by: AlSquire
/2006/08/07/converting-all-newline-characters-to-br-tag/#comment-1363
Mon, 21 May 2007 18:21:04 +0000/2006/08/07/converting-all-newline-characters-to-br-tag/#comment-1363simple_format text helper do the trick
http://api.rubyonrails.org/classes/ActionView/Helpers/TextHelper.html#M000623simple_format text helper do the trick http://api.rubyonrails.org/classes/ActionView/Helpers/TextHelper.html#M000623
]]>by: Stian
/2006/08/07/converting-all-newline-characters-to-br-tag/#comment-1283
Fri, 18 May 2007 14:31:55 +0000/2006/08/07/converting-all-newline-characters-to-br-tag/#comment-1283I believe he was reffering to the /\n/ part. Since /n/ will remove all n-characthers and replace them with :PI believe he was reffering to the /\n/ part. Since /n/ will remove all n-characthers and replace them with :P
]]>by: Akhil Bansal
/2006/08/07/converting-all-newline-characters-to-br-tag/#comment-14
Fri, 18 Aug 2006 12:30:48 +0000/2006/08/07/converting-all-newline-characters-to-br-tag/#comment-14This will remove all new line characters not replace them by <br> :-)This will remove all new line characters not replace them by <br> :-)
]]>by: Pratik
/2006/08/07/converting-all-newline-characters-to-br-tag/#comment-13
Tue, 08 Aug 2006 14:42:52 +0000/2006/08/07/converting-all-newline-characters-to-br-tag/#comment-13def nl2br(s)
s.gsub(/\n/, '')
end
This would be more appropriate :)def nl2br(s)
s.gsub(/\n/, ‘’)
end