9flats.com launched!
Today we have great news: our latest project 9flats.com launched. We have so much fun doing it. The 9flats.com dev-team definitely owns the “most awesome dev-team”-award! I want to say thank you for all these great people working on 9flats, especially: Axel, Sven, Virginio, Thorsten, Stephan, Welf, Stephan, Stefan, Lena, Tim, Michael, Lars, Mike, Jakob, Ralph and Georg.

What is 9flats.com about? 9flats.com gives you the chance to visit unique and beautiful places all over the world. Meet awesome people and places. And if you want to rent out your flat – just do it. Doing that you earn money with something you already have.
I’ll come back with some more technical details regarding 9flats.com. We learned so much in the past few months – so stay tuned!
Introducing simple Facebook Share gem
I really love how JavaScript can help you integrate social media into your application. But using the same code over, and over again is just annoying. Therefore, when I was working on inserting a Facebook share button here and there into our app, I thought, why do I have to repeat everything over and over? So, after a day of hacking, I came up with a simple gem facebook_share. This gem will insert any JavaScript needed for Facebook share buttons to work.
How does it work?
Well, that’s rather simple. After the gem is installed (gem install facebook_share), add this snippet to your ApplicationHelper, and you’re almost ready to go.
Then create file config/initializers/facebook_share.rb with the content below (later versions will automate this process, too). Remember that every parameter here is optional, also that you can include more parameters.
After you type your Facebook application ID, you’re ready to go!
Is it that easy?
Yes, it’s that easy. If you want to share current page, all you have to do is:
But how do I customize it?
What if you have more items I want to share? Or the default selector doesn’t work for your application. Maybe you want to use Dojo? Everything is customizable. For example, you can customize your default settings with facebook_share.rb initializer, and then override these settings while calling helper methods. I will show you couple of examples and showcase most of public methods in the gem.
If you edited your config initializer, at most of the times you won’t need to pass any parameters to the helper functions, but for the sake of the examples, let’s say you’re running both Dojo and jQuery in your project, you have several Facebook applications you want to use, etc.
Example 1: Different selector
will produce:
Example 2: But I already have my JS part!
Probably you already have your Facebook app initialized in your layout and put the #fb-root div tag in there.
will produce:
You can easily switch which JavaScript snippets you want to use.
Example 3: Can I initialize any Facebook application?
Yes, you can. Albeit this gem being mostly for sharing links on Facebook, it can also be used to ease initialization of a Facebook app. For example, it you feed your facebook_share initializer like so:
You can simply do:
in your application layout to get:
Notice how locale‘s value of pl was transformed into pl_PL to meet Facebook expectations, and how only relevant values are included in the Facebook initialization script. Watch out for wrong locales, though, and do not use :locale => "en", as it will produce en_EN, and Facebook will not recognize this code as a proper language.
Example 4: I want my share link to show a different title!
Sometimes you might want to put a more relevant title about what you want people to share on Facebook. Not a problem, every method accepts the same set of parameters (which, by default are configured in facebook_share.rb initializer), and within these parameters you can define any FB.ui parameters, and they will be passed on to that function.
Example 5: But I don’t use jQuery/Dojo!
Again, not a problem, if you have configured your facebook_share initializer, that’s how you can do it:
That’s all, folks
I wrote this gem to help us all with the tedious task of copy/pasting the same Facebook JS code over and over again. I hope some people will find it useful.
In the meantime, install it, play with it, grab source code on github, fork it and code it up!
Jan found a digital photo camera yesterday
Bumi, Georg and me were on the Kamikaze Queens concert yesterday at Sonic Ballroom. On my way back I found a digital photo camera (Traveler XS 4000). Only one picture was on it.
If you’re the owner of this cam, plz hit me on twitter or send me an email.
UPDATE 7 PM: Someone sent me a DM that he knows the owner. How quick was that!?!? :-D I’m happy!
Railslove’s Latest: Flört my Number FB App
We just released our latest app – Flört my Number – in collaboration with Wunderknaben Communications and Das Örtliche, Germany’s phone directory.
Flört my Number is a Facebook app that simulates “a harmless flirt” with the help of interactive video clips – German only, I’m afraid. You can choose whether to flirt with Laura or Ben and try your best to get their number. If you’re fast enough you might make it on the high score list and win an iPhone, Wii or TUI travel coupons – good luck & happy flörting!
Thanks and props to Lena, Dennis, Ecki, Bumi, Lars, Tim, and Paul for coding!


