All posts tagged with 'Code Snippets'

Redcloth / Textilize :hard_breaks is broken in Rails 2.3.4

24-Sep-09

The default behavior for quite a long time was :hard_breaks in the textilize helper method in rails. Hard Breaks means: All line breaks are turned into <br />’s. Somebody changed the textilize helper in “actionpack-2.3.4/lib/action_view/helpers/text_helper.rb” in 2.3.4 and added the ability to pass some options but broke the default behavior here: def textilize(text, *options) options […]

Read the complete article »

Grails: Completely disable stacktrace.log file

24-Mar-09

Regarding my question on twitter about completely disabling the creation of stacktrace.log from a Grails application in production mode, here is my answer: environments { production { log4j = { appenders { null name:’stacktrace’ } } } development { } }environments { production { log4j = { appenders { null name:’stacktrace’ } } } development […]

Read the complete article »

Localizing dates and time with Rails’ I18n using procs

12-Feb-09

Ruby on Rails I18n infrastructure did a great job to internationalization in Rails applications. Most things work right out of the box. Daily Fratze is fully internationalized and i wanted to use ordinal day numbers in the English version. Pity, there is no template for strftime that works that way. As i already hat monkey […]

Read the complete article »