Reetweeten mit Fun - das Rezept gegen Langeweile
“too much time and bored by your timeline? #reetweet! http://reetweet.com“. Das neue “30-minutes-too-much-time-project” von Railslove. Also: auf gehts! reetweet this?.
Btw. Wir warten noch auf eine Ansage von den twitter-Jungs, bezüglich einem Eintrag auf die White-List von Twitter. Dann kann kann man noch mehr Zeit und mit noch mehr Spass - ohne Limits - reetweeten!
[edge Rails] the rails command now supports templates
Setting up a new Rails project is pretty boring. Installing plugins, gems, adding initializers, etc. always the same monotonous work. - not fun.
That’s why there have been quite a lot of starter apps. Most of them are git repositories with blank Rails apps bundled with plugins and extensions. But those are unflexible and the cloning of different repos somehow feels not right. - it’s better but still not fun.
I’ve also tried to avoid the boring setup work with several tools. My first very, very hackish attempt was kickrails. A stupid ruby script that preceduraly runs all the build commands for me. - not fun either.
But then came RG. An awesome über cool project developed by Jeremy McAnally. RG allows you to kickstart your Rails app using templates written in ruby. - fun! ;) One command and your done. RG runs the rails command and setups all the stuff to get you started based on templates.
I’ve created a fork, added some more helpers and used it for several projects. It turned out great.
Anyway what I wanted to tell is: RG just got added to Rails core. This means the rails command now supports templates for building your inital apps. Running rails -m/–template my_super_cool.template not only generates the default rails skeleton for you but also applies the template which installs plugins, gems, extensions, initializes a git repository, etc. - pretty awesome - fun!
I’m as excited as I’ve been when I’ve ran the rails command for the first time.
How do you setup your rails app? Now compare that to:

Isn’t rails great?!
[edge Rails] :only/:except options for map.resources
Today a nice option for the routes was commited to the Rails edge.
map.resources now allows the option :only and :except to specify which routes should be created. Both options accept :none, :all, one action name or an array of action names.
For example:
map.resources :user, :only => :create # GET /users fails # only POST /users is available map.resources :comments, :except => [:update, :destroy] # GET /comments etc. works # PUT /comments/1 fails # DELETE /comments/1 fails
If you have a lot of resources in your routes this allows you to cut memory consumption.
Payment processing mit Rails, Activemerchant (PayPal) und Finite State Machine
Wer schon überlegt hat PayPal als Bezahlungsmöglichkeit auf seiner Rails-Platform zu integrieren, stößt schnell auf die aufschlußreiche Lektüre der Pragmatic Programmers: Payment Processing with Paypal and Ruby. Dieses Buch legt einen sehr guten Grundstein für weitere Ideen wie sich eine Bezahlung via PayPal in einer RubyOnRails Anwendung realisieren lässt.
In diesem Blog-Post soll eine weitere Alternative vorgestellt werden, wie durch den Einsatz von Active Merchant und des Finite State Machine-Plugins eine einfache PayPal Express Bezahlung in Rails realisiert werden kann. Basierend auf dem Blogeintrag von Cody Fauser PayPal Express Payments with ActiveMerchant und, ebenso von Cody Fauster veröffentlichtem eBook Active Merchant; Show me the money! möchte ich den Paymentprozess mit Paypal um das FSM-Plugin erweitern.
Read more
[edge Rails] Inflector.parameterize for easy slug generation
David has just commited an parameterize method for easy slug generation. This means it strips out all special characters so that it can be savely used in URLs. It replaces anything but a-z and 0-9 with a “-” (you can pass a custom seperator).
Example to generate nice URLs for your models:
def to_param "#{id}-#{name.parameterize}" end
"$%hello I'm a sentence with & a löt òf SPECIAL chars+".parameterize #=> -hello-i-m-a-sentence-with-a-lt-f-special-chars-
My find_by_param plugin, that helps you a lot with working with nice URLs, uses a custom encoding method to do this. Perhaps I will change that some time soon. ;)
Update:
The comments on the commit pointed to two really nice projects:
1. stringex - which is a bit of a overkill. *tries to solve everything* but creates really aweseome slugs by translating special chars ($ to dollar, etc.)
2. slugalizer - a ruby slugalizer which ses ActiveSupport for platform-consistent normalization. It also does nice formatting like: Åh, räksmörgåsar! => ah-raksmorgasar”
Update2
This feature was extended earlier today. Not nice conversions like Malmö = malmo or Garçons = garcons are supported.
