P
A
B
C
A
S
Thoughts, links, pictures on music, food, wine, film, tech etc.
about 1 year ago
I shared this:
'fd' tab trigger in TextMate for creating new Rails form fields
In my screencast below, I used an 'fd' tab trigger in Textmate to generate a div containing a field and a label. This isn't part of the Rails Textmate bundle. Here's the code to generate a label and field inside a div:
<div> ${RAILS_TEMPLATE_START_RUBY_EXPR}f.label :${1:attribute}${2:, "${3:${1/[[:alpha:]]+|(_)/(?1: :\u$0)/g}}"}${RAILS_TEMPLATE_END_RUBY_EXPR} ${RAILS_TEMPLATE_START_RUBY_EXPR}f.text_field :${1:attribute}${RAILS_TEMPLATE_END_RUBY_EXPR} </div>