Template Wrapper


Wrap all your rails views in TextMate-aware containers for easy viewing and editing in development.

Works with Rails 2.3.8 or higher

install and go

> gem install template_wrapper

Rails3


  # Gemfile
    + gem "template_wrapper"
  > bundle install

Rails 2

  
  # environment.rb Initializer block
    + config.gem 'template_wrapper'
  > rake gems:install

OMITTING TEMPLATES FROM THE RENDERER

Sometimes you might not want this kind of mucking about (i.e. a partial in your <head>). Add this to the top :

<%= skip_wrap(__FILE__) %>

Alternately, you can change the layout incrementally : <%= skip_wrap(__FILE__, :comment) %> # wraps template code in an HTML comment only <%= skip_wrap(__FILE__, :blank) %> # skips (default for this method) <%= skip_wrap(__FILE__, :icon) %> # icon only

Rake task for an initializer:

> cd /path/to/your/app

> rake template_wrapper:customize

Installs initializer to : config/initializers