Monthly Archives: April 2011

getting bundler, unicorn to play nice with a rails 2.3.x-app

We have a situation here:
– a rails 2.3.5 app
– unicorn must be used as deploy solution
– rack gems 1.1.0 AND 1.0.1 installed

unicorn_rails requires rack 1.1.0
after that somewhere in the rails app rack 1.0.1 is required

So we get an error like this: “can’t activate rack (~> 1.0.1, runtime) for [], already activated rack-1.1.0”

Our solution:
– use bundler:
– small modifications in the rails 2.3.x-files:
– configure and create the gem bundle
– start unicorn in the “bundler context” like this:
/usr/local/bin/bundle exec “/usr/local/bin/unicorn_rails -c config/unicorn.rb -E production”

powermail long forms optimisations

We are often using the great powermail extension for typo3.

At the current project we have some very long forms – the user needs to scroll several “monitors” to finish.

And now we have the following problem: if one of the upper mandatory form fields isn’t completed or has an invalid form – the user does not see it and the form will not submit.
That’s why we extended the form validator with a callback function that scrolls up to the first error.

Here is the typoscript setp code we used in the template:

    page.jsFooterInline.10.100.100 = TEXT
    page.jsFooterInline.10.100.100.value (

        powermail_validator = $('.tx_powermail_pi1_form').validator($.extend({
           inputEvent: 'blur',
           grouped: true,
           singleError: false,
           onBeforeValidate: function(e, els) {               
               clearPlaceholderValue(e, els);
           onBeforeFail: function(e, els, matcher) {
               setPlaceholderValue(e, els, matcher);
        }, powermail_customValidatorConfiguration)).bind("onFail", function(e, els)  {   
              $('html,body').animate({ "scrollTop": $(els[0].input).offset().top-50}, 1000);