# JavaScriptGenerator in separate .js file, not a view

**URL:** <https://www.ruby-forum.com/t/javascriptgenerator-in-separate-js-file-not-a-view/134120>\
**Category:** Rails\
**Created:** [April 8, 2008, 2:45am UTC](https://www.ruby-forum.com/t/javascriptgenerator-in-separate-js-file-not-a-view/134120 "2008-04-08T02:45:01Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![pahagon](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/p/ac8455/32.png) [@pahagon](https://www.ruby-forum.com/u/pahagon)\
**Post date:** [April 8, 2008, 2:45am UTC](https://www.ruby-forum.com/t/javascriptgenerator-in-separate-js-file-not-a-view/134120/1 "2008-04-08T02:45:01Z")

</div>

Is it possible to get some code with JavaScriptGenerator to be  
rendered in a separate .js file, not just put in a view with

Is this possible?

I haven’t found any info on this topic, my guess is that this is not  
possible, but I wanted to make sure.

---

<div class="post-metadata">

**Author:** ![pahagon](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/p/ac8455/32.png) [@pahagon](https://www.ruby-forum.com/u/pahagon)\
**Post date:** [April 8, 2008, 9:28am UTC](https://www.ruby-forum.com/t/javascriptgenerator-in-separate-js-file-not-a-view/134120/2 "2008-04-08T09:28:08Z")

</div>

On Apr 8, 1:44 am, Paulo P. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> I haven’t found any info on this topic, my guess is that this is not  
> possible, but I wanted to make sure.

How about if you had a separate action (and probably controller) that  
just rendered some rjs ?

Fred
