TextMate Cheat Sheet for Rails Hackers

⌃ = control ⌘ = command ⌥ = option ⇧ = shift ⌃⌥⌘S Tab Trigger

File Navigation
go to file go to line go to method find in project reveal in project
⌘T ⌘L ⇧⌘T ⇧⌘F ⌃⌘R

Snippets

Editing
code completion fold / unfold comment selection indent selection move selection edit selection column selection insert tag
Escape F1 ⌘/ ⌘ [ and ⌘ ] ⌃ ⌘ (arrow) ⌥⌘A ⌥ (drag) ⌃⇧<

⌃⇧W wrap selection in tag close tag ⌥⌘. wrap selection as link ⌃ ⇧ L ⌃⇧A subversion menu name ⇧ ↩ new method

class class_name class def def method_name each { |element| ... } each forin for element in collection if condition if or ifelse unless condition unless : :key => "value" flash[:notice] = "..." flash logi logger.info "..." ae assert_equal value, @o.attr redirect_to options rec[ai] render :action => "action" ra rp[loc] render :partial => "item" create_table "table" ... mct mcc table.column : , : lic[ai] <%= link_to options ... <% for item in @items ... eforin ft <%= form_tag options ... has_many :objects ... hm belongs_to :object ... bt vpif validates_presence_of :attr ...
Hot Key

Commands
run file as ruby start irb

⌃⌥⌘C ⌘R ⌃⇧I

=> params[:id] session[:user] <% %> <%= %>

⌃L ⌃P ⌃J ⌃X ⌃Z
Copyright © Mike Clark
Updated: 4/29/06

Need Rails Training? http://pragmaticstudio.com

Master your semester with Scribd & The New York Times

Special offer for students: Only $4.99/month.

Master your semester with Scribd & The New York Times

Cancel anytime.