Monday, October 1, 2012

After 12 months of development I am really happy to announce, a platform to create your custom wedding website. It is being developed with Rails 3.2 and mongodb and runs on Amazon EC2 and Cloudfront. Here is what I am excited about:

  • The available wedding themes are illustrative and fresh, not too traditional.
  • The user interface is very modern, a lot of drag and drop and inplace editing, no need to switch to preview mode all the time because you instantly see how your page looks like.
  • It uses the approach 'less is more' when it comes to features. No 'feature jungle' as on comparable websites.
Please give it a try yourself or pass on the link if you know someone who gets married. I'm also happy to discuss technology topics regarding the platform. 

Monday, August 20, 2012

Safari 6 - what a disappointment

I recently upgraded to Safari 6. I was hoping for another Apple improvement, but I can't believe what Apple did to Safari. The unified addressbar / searchbar is just annoying and the new WebInspector is  a mess and just unusable. First, I decided to just give it a try for a couple of days, but it didn't help. Safari was my favourite browser to develop and test webapps for the last two years, but now I will switch back to good old Firefox. Not a nice job, Apple.

Monday, February 28, 2011

simple-navigation Version 3

This post is long overdue. The new version of simple-navigation is a complete rewrite and can now be easily extended to support any ruby based webframework.

The key features of the new version 3 are:
  • supports Ruby 1.9.2
  • supports Rails 3
  • supports Sinatra
  • supports Padrino
  • much cleaner code due to decoupling of rails
  • added more renderers (breadcrumbs, text only, links only in addition to the default html list renderer)
More information can be found on the github page and the wiki. Please report any issues or just post to the mailing list.
There is also a new public project with a sample application running with Rails2, Rails3, Sinatra and Padrino.

Tuesday, October 26, 2010

Installing ruby with rvm using local readline and iconv

To install ruby with rvm using your local readline and iconv libraries on SnowLeopard, execute

rvm install 1.8.7 -C --with-readline-dir=/usr/local,--with-iconv-dir=/usr/local,--build=x86_64-apple-darwin10

Saturday, October 10, 2009

Simple Navigation Plugin Version 2

About six months ago I wrote about the first release of the simple navigation plugin. It's a GemPlugin to generate the navigation for your ruby on rails applications.

As far I can judge from the feedback I got from the community it seems like a lot of people are using the plugin. So I'm really happy to announce version 2 of the simple navigation plugin.

The main new features are
  • create as many navigation levels you like (so far it was limited to primary and sub navigation
  • the active navigation item gets highlighted automatically (no more explicit configuration of the active item in the controllers needed)
Please check out the
and see some live examples on the demo page.

For providing feedback or get help visit the discussion group or drop me a line on github.

Tuesday, October 6, 2009

Making ActionMailer testable

If you ever create a custom subclass of ActionMailer you'll be having a hard time to test it. That's because - by default - you cannot access the ActionMailer instance after creating a mail. To make ActionMailer testable you have to make its new-method public:

    1 class ActionMailer::Localized < ActionMailer::Base
3 #to make ActionMailer testable
4 public_class_method :new
6 private
8 #we would like to test that the correct template is set
9 def initialize_defaults(method_name)
10 super
11 @template = "#{I18n.locale}_#{method_name}"
12 end
14 end

With that change it's easy to test the initialize_defaults-method (as shown here using rspec):

    1 describe ActionMailer::Localized do
3 before(:each) do
4 @localized_mailer = do
5 def mailer_method(mail_object); end
7 @localized_mailer.stub!(:render)
8 I18n.locale = 'de'
9 end
11 describe 'after being initialized' do
12 before(:each) do
13 @localized_mailer.create!('mailer_method',
14 end
15 it "should have the localized template name set" do
16 @localized_mailer.template.should == 'de_mailer_method'
17 end
18 end
20 end

Localized ActionMailer Templates for Rails

Rails actually does support localized templates, however, this does not apply for localized ActionMailer templates (yet?). Even if you add the correct locale to your mailer template names, ActionMailer does not choose the one based on the current locale.

It's really easy to fix this:

Just create a subclass of ActionMailer::Base and override the initialize_defaults method as shown below. Then let your mailers inherit from your new subclass.

    1 class ActionMailer::Localized < ActionMailer::Base
3 private
5 # we override the template_path to render localized templates (since rails does not support that :-( )
6 # This thing is not testable since you cannot access the instance of a mailer...
7 def initialize_defaults(method_name)
8 super
9 @template = "#{I18n.locale}_#{method_name}"
10 end
12 end

Define your desired template name as shown on line 9, just do not add your locale as dot-notation at the end of the file. E.g. will not work.