You are on page 1of 2

TextMate Cheat Sheet for Rails Hackers

⌃ = control ⌘ = command ⌥ = option ⇧ = shift


Copyright © Mike Clark
Updated: 4/29/06
File Navigation
go to method ⇧ ⌘ T
reveal in project ⌃ ⌘ R
comment selection
code completion Escape
move selection ⌃ ⌘ (arrow)
Editing
⌘ /
Snippets
Tab Trigger
Hot Key
<% %> ⌃ X
run file as ruby ⌘ R
Commands
Need Rails Training?
http://pragmaticstudio.com
⌃ ⌥ ⌘ S
⌃ ⌥ ⌘ C
class class_name class
flash[:notice] = "..." flash
<%= link_to options ... lic[ai]
render :action => "action" ra
def method_name def
each { |element| ... } each
for element in collection forin
unless condition unless
logger.info "..." logi
redirect_to options rec[ai]
<%= form_tag options ... ft
params[:id] ⌃ P
=> ⌃ L
session[:user] ⌃ J
<%= %> ⌃ Z
go to file ⌘ T
go to line ⌘ L
find in project ⇧ ⌘ F
fold / unfold F1
indent selection ⌘ [ and ⌘ ]
start irb ⌃ ⇧ I
render :partial => "item" rp[loc]
ae
if condition if or ifelse
:key => "value" :
<% for item in @items ... eforin
edit selection ⌥ ⌘ A
column selection ⌥ (drag)
insert tag ⌃ ⇧ <
has_many :objects ... hm
belongs_to :object ... bt
table.column : , : mcc
assert_equal value, @o.attr
create_table "table" ... mct
validates_presence_of :attr ... vpif
close tag ⌥ ⌘ .
subversion menu ⌃ ⇧ A
wrap selection as link ⌃ ⇧ L
new method name ⇧ ↩
wrap selection in tag ⌃ ⇧ W
ftfft