Dä Kölsch Zähler launched!
Ladies and Gentleman – Railslove and Payango proudly introduce you to “Dä Kölsch Zähler”. What is it about? In the next few days, Cologne (Germany) is going to get crazy. Carnival is coming and on Thursday almost every citizen in the city will be celebrating the “fifth season” here. Almost everything is closed: shops, offices, etc. And instead people will be drinking “Kölsch”. How much Kölsch will be drunk? Nobody knows. So, we decided to count it, and so the idea of “Dä Kölsch Zähler” was born. Tech-Specs: Kölsch Zähler is based on JQueryMobile, Ruby on Rails and Pusherapp. The amount of beer per Table is directly pushed to the other Mobilephones connected.
To be honest: we really have better and more important stuff to do! But this is a kind of “app in a day” project where hacking brings people together. We love building web applications!
Follow @koelschzaehler on twitter, become a fan on Facebook and visit “Dä Kölsch Zähler” while drinking Kölsch on Carnival in Cologne!
Prost!
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!
Locate those Missing Puts!
Do you co workers sometimes forget to remove their #puts; or do you sometimes forget where you put* yours? …
Now you can find them ;D
* Pun intended
This year´s Rails Rumble
As co-founders of Coworking Cologne and lightweight sponsors of this year´s Rails Rumble we´re happy to announce that Coworking Cologne opens its doors for Rumble Rails Rumble teams during the 2010 Rails weekend from October 16th-18th and offers free work spaces to use during the 48 hour competition. The competition will begin Saturday, October 16th at 2am (MEZ) and continue until Monday, October 18th at 01:59am.
If your team is looking for a space to work on your app and hang with other Rumblers feel free to join us at Coworking Cologne just give us a call or contact at team@railslove.com.
For more information about the space check out coworkingcologne.de.
Testing CSV Download With Cucumber
Thanks to Upstream for their blog post on testing pdfs with cucumber.
Testing CSV download is exactly the same apart from that we do not need to turn the PDF to text, simply because…it isn’t a PDF…
(From RedWritesHere)

