Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Formatting ERB Templates automatically in textmate

When writing ERB templates in Ruby on Rails using Textmate formatting by hand pretty much sucks.

Do anyone know of a textmate bundle that handles formatting of ERB templates/views? My googling has found nothing. Thanks!

like image 434
Scott Schulthess Avatar asked Jan 17 '10 15:01

Scott Schulthess


1 Answers

I think the best solution is to use the HTML (Rails) bundle. And when you want to tidy something, you'll need to go up to the Bundles menu > HTML > Tidy.

That coupled with Indent Selection (--[) , handles most of my reformatting needs.

NOTE: unfortunately, when in the HTML (Rails) bundle, the normal tidy shortcut --H gets overridden and instead launches the "Create a partial from the selected text" when in a *.html.erb file. I'm sure there's a way to change this but it hasn't been a big enough deal for me to investigate.

like image 89
bndev Avatar answered Sep 23 '22 06:09

bndev