You are on page 1of 1

TextMate Cheat Sheet for Rails Hackers

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

File Navigation Snippets ⌃⌥⌘S

go to file ⌘T Tab Trigger

go to line ⌘L class class_name class


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

Need Rails Training? Copyright © Mike Clark


http://pragmaticstudio.com Updated: 4/29/06

You might also like