# How to capture not eval'ed ERB

**URL:** <https://www.ruby-forum.com/t/how-to-capture-not-evaled-erb/183661>\
**Category:** Rails\
**Created:** [February 18, 2010, 1:34pm UTC](https://www.ruby-forum.com/t/how-to-capture-not-evaled-erb/183661 "2010-02-18T13:34:33Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![stevo84](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/f14d63/32.png) [@stevo84](https://www.ruby-forum.com/u/stevo84)\
**Post date:** [February 18, 2010, 1:34pm UTC](https://www.ruby-forum.com/t/how-to-capture-not-evaled-erb/183661/1 "2010-02-18T13:34:33Z")

</div>

Hello

I need to capture a piece of erb by helper, modify it slighlty and  
render it back. Really simplified version below:

def call\_tag(tagname, \*attrs, &block)  
content = capture(&block)  
concat render(:inline =\> process\_content(content) :layout =\>  
false)  
end

However if content contains any escaped js, it will be escaped again  
and left not working anymore. Is there ANY way to get ERB source and  
to already compiled one (through capture helper) ?
