Today's Textmate Tip 2

Written by on Jun 26 2007

Here is a snippet all of you jQuery on Rails people can use:

Here’s how to make a snippet that will output:

jq(function(){

})

 

Control-Option-Command-b to open the Bundle Editor. # Go to either the HTML or Javascript bundle (or jQuery bundle (you did know there was a jQuery bundle right?)). # Click on the Plus at the bottom left of the editor to create a new snippet. # Name the snippet “jq” or something. # Paste the following in the Editor window and close the window.

jq(function(){ $1 })

 

Now you can jq->tab to get the snippet. In an rhtml file the cool [obtrusive javascript] kids go: script->tab->jq->tab ;)

Meet
Steven

Hi I'm Steven,

I wrote the article you're reading... I lead the developers, write music, used to race motorcycles, and help clients find the right features to build on their product.

Get Blog Updates