Greg, your solution works great. However, it can interfere with js
templates. So i added <% if request and request.xhr? %> to the
injected code.
Frederick, will look into it when im in the office :)
Greetings

2009/10/13, Greg Donald <[email protected]>:
>
> On Mon, Oct 12, 2009 at 3:29 AM,  <[email protected]> wrote:
>> Do you know of an easy way to identify which part of a page comes from
>> which
>> partial file? Perhaps a plugin adding a border or something?
>
> This will add comments to your erb templates:
>
> unless RAILS_ENV == 'production'
>   module ActionView
>     module TemplateHandlers
>       class ERB < TemplateHandler
>         include Compilable
>         cattr_accessor :erb_trim_mode
>         self.erb_trim_mode = '-'
>         def compile(template)
>           src = ::ERB.new("<% __in_erb_template=true %>\n<!-- BEGIN #{
> template } -->\n#{ template.source}\n<!-- END #{ template } -->\n",
> nil, erb_trim_mode, '@output_buffer').src
>           RUBY_VERSION >= '1.9' ? src.sub(/\A#coding:.*\n/, '') : src
>         end
>       end
>     end
>   end
> end
>
> Mine lives in my environment.rb.
>
>
> --
> Greg Donald
> http://destiney.com/
>
> >
>

-- 
Von meinen Mobilgerät aus gesendet

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to