jEdit Shortcuts for Ruby on Rails Documenation

Reference guide for the jEdit Shortcuts for Ruby on Rails. Using the SuperAbbrevs plugin, we can acheive Textmate/Eclipse-like functionality with code snippet templates. Typing a key combo and hitting [CTRL-ENTER] (if that is your chosen key mapping) will expand into a template and allow you to simply fill in the blanks.

This goes beyond the Textmate rails bundle and adds a lot more, particularly on the RHTML side.

Now what are you gonna do with all that time you’re saving?

Ruby

Model

bt        belongs_to
hm        has_many
ho        has_one

Environment

flash     flash[...]
logi      logger.info
s         session[...]
p         params[...]

Controller

rcea      render_component (action)
rcec      render_component (controller)
rceca     render_component (controller, action)
rea       redirect_to (action)
reai      redirect_to (action, id)
rec       redirect_to (controller)
reca      redirect_to (controller, action)
recai     redirect_to (controller, action, id)
verify    verify render
verifyr   verify redirect 

Render

ra        render (action)
ral       render (action, layout)
rt        render (text)
ri        render (inline)
ril       render (inline, locals)
rit       render (inline, type)
rp        render (partial)
rpc       render (partial, collection)
rpo       render (partial, object)
rps       render (partial, status)
rpl       render (partial, locals)
rl        render (layout)
rt        render (text)
rtl       render (text, layout)
rtlt      render (text, layout => true)
rts       render (text, status)
rf        render (file)
rfu       render (file, use_full_path)
rn        render (nothing)
rns       render (nothing, status)

Migration

mct       Migration Create Table
mdt       Migration Drop Table
mac       Migration Add Column
mrc       Migration Remove Column
mcc       Migration Change Column
mnc       Migration Rename Column
mai       Migration Add Index
mri       Migration Remove Index
mex       Migration Execute
mtc       Migration Create Table Column Definition (t.column ...)

Assertions

ae        Test Assert Equal
ann       Test Assert Not Nil
ako       Assert Kind Of
are       Assert Response
art       Assert Redirected To
ar        Assert Raise

Validation

va        Validates Associated
vaif      Validates Associated If
vc        Validates Confirmation Of
vcif      Validates Confirmation Of If
ve        Validates Exclusion Of
veif      Validates Exclusion Of If
vp        Validates Presence Of
vpif      Validates Presence Of If
vu        Validates Uniqueness Of
vuif      Validates Uniqueness Of If

RHTML

ERB

pr        <% code %>
pe        <%= output %>

Misc

cfl       <%= @content_for_layout %>
rp        render(partial)
rpc       render(partial, collection)
it        image_tag(url, alt)

Control

forin     for .. in .. end
if        if .. end
ife       if .. else .. end
ifei      if .. elsif .. end
ifeie     if .. elsif .. else .. end

Forms

ft        form_tag(action) ... end_form_tag
emf       error_messages_for(object)
cb        check_box(object, method)
cbt       check_box_tag(name)
ds        date_select(object, method, order)
ff        file_field(object, method)
hf        hidden_field(object, method)
hft       hidden_field_tag(name)
ist       image_submit_tag(url, alt)
pf        password_field(object, method)
pft       password_field_tag(name)
rb        radio_button(object, method, tag_value)
rbt       radio_button_tag(name, value)
s         select(object, attribute, list_items)
st        submit_tag(name)
ta        text_area(object, method)
tat       text_area_tag(name)
tf        text_field(object, method)
tft       text_field_tag(name)
pta       <p><label for="object_method">Title:</label>
          <%= text_area("object", "method") %></p>
ptf       <p><label for="object_method">Title:</label>
          <%= text_field("object", "method") %></p>

Links

lia       link_to (action)
liai      link_to (action, id)
lic       link_to (controller)
lica      link_to (controller, action)
licai     link_to (controller, action, id)

HTML

t         <tag_name></tag_name>
at        attribute="value"
a         <a href="link">link text...</a>
div       <div id/class="name">content</div>
span      <span id/class="name">content</span>
dths      Doctype / HTML 4 Strict
dtht      Doctype / HTML 4 Transitional
dthf      Doctype / HTML 4 Frameset
dtxs      Doctype / XHTML 1.0 Strict
dtxt      Doctype / XHTML 1.0 Transitional
dtxf      Doctype / XHTML 1.0 Frameset
dtx1      Doctype / XHTML 1.1
htdoc     Full XHTML 1.0 Strict starter template
htt       http://
img       <img src="url" atl="name" title="tool tip" />
meta      <meta name="keywords/description/robots" content="content" />
metah     <meta http-equiv="expires/pragma/refresh/set-cookie/window-target" content="content" />
link      <link rel="stylesheet" type="text/css" href="stylesheets/screen.css" />
ol        <ol id/class="name"><li>first item</li></ol>
ul        <ul id/class="name"><li>first item</li></ul>
style     <style>entity { color: #000; }</style>
table     <table><tr><td></td><tr></table>
trtd      <tr><td></td><tr>
td        <td></td>