I’ve been up at this all night long
I’ve been drowning in my sleep
I’ve prayed for your safe place
And its time for us to leave
Time is running, its running on empty and the gas is running out
I’ve decided that tonight is the night
That I let love aside
Full speed ahead this seems to be the place
I’ve seen this once before
Planned perfection sought in my dreams
Hoping this would take you home
My knuckles have turned to white
There’s no turning back tonight
Kiss me one last time
Around this turn where the cross will cast your shadow
The people will all gather
To remember such a day
Where the flames grew as high as trees
And the world stopped
It stopped for you and me
My knuckles have turned to white
There’s no turning back tonight
Kiss me one last time
(Shut your eyes)
My knuckles have turned to white
There’s no turning back tonight
(So hold on tight)
Kiss me one last time
(Shut your…)
I will now bring new meaning to the word alone
Endless nights of dreaming of life
And the days we should have spent here
Drowning in my sleep I’m drowning in my sleep
Drowning in my sleep I’m drowning in my sleep
(x6)
Glass shatters and comes to a halt
I thought we’d be there by now
I thought it would be so much quicker than this
Pain has never been so brilliant
I made sure you were buckled in
Now you can walk hand in hand
Hand in hand with Him
My knuckles have turned to white
There’s no turning back tonight
Kiss me one last time
(Shut your eyes)
My knuckles have turned to white
There’s no turning back tonight
(So hold on tight)
Kiss me one last time
(Shut your…)
Die habtm-Funktionalität in Rails ist für n:m-Beziehungen gedacht. Beispiel: ein User soll Teil verschiedener Gruppen sein können und einer Gruppe sollen mehrere User angehören können. Was aber, wenn jede dieser Beziehungen zusätzliche Attribute mit sich bringen soll? Beispiel: User 1 hat in Gruppe 1 die Rolle “admin” inne, in Gruppe 2 “member” etc. Hierfür bietet sich sich eine “has_many through”-Beziehung an. Weiteres unter http://www.infused.org/2005/12/06/has-many-through-association/
Es lebe die nl2br-Funktion! Nur leider hatte ich sie bei Rails bzw. Ruby nicht gefunden (inzwischen schon, siehe Ende des Beitrags). Darum hatte ich kurzerhand ein klitzekleines Plugin namens EnhanceString für Rails geschrieben, dass die String-Objekte um die nl2br-Funktion erweitert.
Für Ahnungslose: nl2br() ist eine Funktion der PHP Syntax, die alle Zeilenumbrüche eines Strings in dessen HTML-Entsprechung <br/> umwandelt.
In das Verzeichnis /vendor/plugins der Applikation auspacken
Webserver neu starten
Anwendung
“Erstens..,\nZweitens..”.nl2br
gibt
=> “Erstens..,<br/>Zweitens..”
zurück.
Die Funktion simple_format aus dem TextHelper von Rails regelt dies eleganter. Es werden zusätzlich <p>-Tags um den zu formatierenden String und außerdem bei zwei aufeinander folgenden Zeilenumbrüche gesetzt. Die Zeilenumbrüche bleiben allerdings erhalten, das <br/>-Tag wird hinter jedem einzelnen Zeilenumbruch hinzugefügt. Beispiel