# Html/JavaScript/CSS code ouput in TextArea-- Best Ways

**URL:** <https://www.ruby-forum.com/t/html-javascript-css-code-ouput-in-textarea-best-ways/184470>\
**Category:** Ruby\
**Created:** [March 3, 2010, 3:28am UTC](https://www.ruby-forum.com/t/html-javascript-css-code-ouput-in-textarea-best-ways/184470 "2010-03-03T03:28:45Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![smarter](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/9fc29f/32.png) [@smarter](https://www.ruby-forum.com/u/smarter)\
**Post date:** [March 3, 2010, 3:28am UTC](https://www.ruby-forum.com/t/html-javascript-css-code-ouput-in-textarea-best-ways/184470/1 "2010-03-03T03:28:45Z")

</div>

Hello:

What would be the best way to Output Code in TextArea for a UI  
component?  
The Rails App View is pure HTML and JavaScript.

> > render in text for controller action and the text is the code string.  
> > The \< and \> etc can be passed as is in this mode.

> > Read a HTML Template File (containing JS and CSS references) in Public directory(?) that needs to be substitute some variables that were inputted in a form by the user.

> > Create HTML on Ruby Side with some XML Builder instead of Reading a File.  
> > And then pass that String to code.

Please advise.

Thank you.

---

<div class="post-metadata">

**Author:** ![smarter](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/9fc29f/32.png) [@smarter](https://www.ruby-forum.com/u/smarter)\
**Post date:** [March 3, 2010, 3:33am UTC](https://www.ruby-forum.com/t/html-javascript-css-code-ouput-in-textarea-best-ways/184470/2 "2010-03-03T03:33:18Z")

</div>

Smart RoR wrote:

> Hello:
> 
> What would be the best way to Output Code in TextArea for a UI  
> component?  
> The Rails App View is pure HTML and JavaScript.
> 
> > > render in text for controller action and the text is the code string.  
> > > The \< and \> etc can be passed as is in this mode.
> 
> > > Read a HTML Template File (containing JS and CSS references) in Public directory(?) that needs to be substitute some variables that were inputted in a form by the user.
> 
> > > Create HTML on Ruby Side with some XML Builder instead of Reading a File.  
> > > And then pass that String to code.
> 
> Please advise.
> 
> Thank you.

Sorry, this probably should be in Ruby on Rails forum.  
Thanks.
