RadRails Template Documentation
Ruby
- alias – alias
- atr – attribute reader
- begin – begin rescue block
- begin – begin rescue ensure block
- block – do…end single variable block
- block – do…end two variable block
- block – single variable block
- block – two variable block
- case – case statement
- class – Class Definition
- class – class with initialize
- class – Singleton Class Definition
- def – def with params
- def – method definition
- defs – class method definition
- each – each block
- else – else block
- elsif – elsif block
- for – for – iterate over Collection
- for – for – iterate over Range
- if – if block
- ifeif – ifelseif block
- ifelse – if-else block
- inject – inject block
- lambda – lambda block
- loop – loop block
- module – Module definition
- pp – plus plus
- r – require
- rescue – rescue block
- rescue – rescue block with error variable
- until – until loop
- while – while loop
- while – while statement
Get the ruby pack Here
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,action)
- reca – redirect_to(controller,action)
- recai – redirect_to(controller,action,id)
- reu – redirect_to(url)
- verify – verify
- verifyr – verify redirect
Get the controller pack here
Models
- aal – acts_as_list
- aat – acts_as_tree
- bt – belongs to
- bt – belongs to basic
- find – find
- find – find conditions order
- find – find conditions order group
- finda – find all
- findf – find first
- habtm – has and belongs to many
- hm – has many complex
- hm – has_many
- ho – has one
- ho – has one complex
Get the models pack here
Validation
- va – validates_associated(attributes)
- vaco – validates_acceptance_of(attribute,message)
- vaif – validates associated if
- vaon – validates_associated(attributes) on
- vc – validates_confirmation_of(attributes,message)
- vcif – validates confirmation of attribute on message if
- vcon – validates_confirmation_of(attributes,message) on
- ve – validates_exclusion_of(attribute,in,message)
- veach – validates_each
- veif – validates exclusion if
- vf – validates_format_of(attribute,with,message)
- vi – validates_inclusion_of(attribute,in,message)
- vl – validates_length_of(attribute,maximum,message)
- vl – validates_length_of(attribute,minimum,message)
- vl – validates_length_of(attribute,range,message)
- vn – validates numericality of
- vp – validates_presence_of(attribute,message)
- vpif – validates_presence_of(attribute,message)
- vs – validates_size_of(attribute,maximum,message)
- vs – validates_size_of(attribute,minimum,message)
- vs – validates_size_of(attribute,range,message)
- vu – validates_uniqueness_of(attribute,message)
- vuif – validates_uniqueness_of(attribute,message)
- vus – validates_uniqueness_of(attribute,message,scope)
- vusif – validates_uniqueness_of(attribute,message,scope)
Get the validation pack here
Render
- ra – render action
- ral – render action,layout
- rf – render(file)
- rfu – render(file,use_full_path)
- ri – render(inline)
- ril – render(inline,locals)
- rit – render(inline,type)
- rl – render(layout)
- rn – render(nothing)
- rns – render(nothing,status)
- rp – render(partial)
- rpc – render(partial,collection)
- rpl – render(partial,locals)
- rpo – render(partial,object)
- rps – render(partial,status)
- rt – render text
- rtl – render text layout
- rtlt – render text layout true
- rts – render text status
Get the render pack here
Environment
- flash – flash[]
- logi – logger info
- logn – logger notice
- logw – logger warning
- p – params
- s – session
- sset – session setter
Get the environment pack here
Migration
- mac – add column
- mai – add index
- mcc – change column
- mct – create table
- mdt – drop table
- mex – execute
- mnc – rename column
- mrc – remove column
- mri – remove index
- mtc – t.column create
Get the migration pack here
Testing
- ae – assert_equal
- aio – assert instance of
- ako – assert_kind_of
- am – assert match
- an – assert nil
- ane – assert not equal
- anm – assert not match
- ann – assert_not_nil
- ar – assert_raise
- are – assert_response
- aret – assert respond to
- art – assert_redirected_to
Get the testing pack here
Rspec
- cn – controller name
- cshra – controller should have rendered action
- cshrt – controller should have rendered text
- cshrte – controller should have rendered template
- csra – controller should render action
- csrdt – controller should redirect to
- csrr – controller should render rjs
- csrrp – controller should render rjs page
- csrt – controller should render text
- csrte – controller should render template
- rsbr – response should be redirect
- rsbs – response should be success
- sbe – should be empty
- sbio – should be instance of
- sbn – should be nil
- sbs – should be something
- se – should equal
- sh – should have
- shr – should have rjs
- shrp – should have rjs page
- sht – should have tag
- shtc – should have tag content
- sm – should match
- snbe – should not be empty
- sne – should not equal
- snm – should not match
- srt – should respond to
- ss – should something
Get the rspec pack here
Rhtml
- a – html link
- at – attributes
- cb – check box
- cbt – check box tag
- cfl – content for layout
- comment – comment
- div – div
- ds – date select
- dth1 – doctype xhtml 1.1
- dthf – doctype 4 frameset
- dths – doctype html strict
- dtht – doctype html transitional
- dtxf – doctype xhtml frameset
- dtxs – doctype xhtml strict
- dtxt – doctype xhtml transitional
- emf – error message for
- ff – file field
- forin – for…in..end
- frt – form_remote_tag(html)
- ft – form_tag
- hf – hidden field
- hft – hidden field tag
- htdoc – document outline
- htt – http://
- if – if block
- ifei – if else if
- ifeie – if else if else block
- ifelse – if else block
- img – image
- ist – image submit tag
- it – image tag
- li – li
- lia – link_to(action)
- liai – link_to(action,id)
- lic – link_to(controller)
- lica – link_to(controller,action)
- licai – link_to(controller,action,id)
- link – link
- ltr – link_to_remote(name,update,url)
- meta – meta tag
- metah – meta http equiv
- ol – ol
- pe – pe
- pf – password field
- pft – password field tag
- pm – percent minus
- pr – asp style script tags
- pta – p text area
- ptf – p text field
- rb – radio button
- rbt – radio button tag
- rp – render partial
- rpc – render partial collection
- s – select
- span – span
- st – submit tag
- style – style
- ta – text area
- table – table
- tat – text area tag
- td – td tag
- tf – text field
- tft – text field tag
- trtd – tr and td
- tt – closed tag
- ul – ul
Get the rhtml pack here
Finally, documentation as promised. You can get the entire set of packs here as one zip file with all of the individual xml files inside. Or you can just download this zip and get it as two files. One for RHTML, and one for Ruby.
I’d also like to share my script for making this documentation. It should work for any Eclipse template file. Change the extension to .rb, and drop it in the directory with the xml files. Run it and it should create a txt file for each xml file in the directory. The text file is in textile and it is simply a h2 followed by a list of the templates. Enjoy