# RJS Templates?

**URL:** <https://www.ruby-forum.com/t/rjs-templates/81456>\
**Category:** Rails\
**Created:** [November 18, 2005, 7:20pm UTC](https://www.ruby-forum.com/t/rjs-templates/81456 "2005-11-18T19:20:21Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![dteare](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/8e7dd6/32.png) [@dteare](https://www.ruby-forum.com/u/dteare)\
**Post date:** [November 18, 2005, 7:20pm UTC](https://www.ruby-forum.com/t/rjs-templates/81456/1 "2005-11-18T19:20:21Z")

</div>

I’ve seen a couple of commits lately re: RJS templates. Where can I  
find more info on what these are? Google came up empty ☹

> > Make rjs templates always implicitly skip out on layouts.

Thanks!

---

<div class="post-metadata">

**Author:** ![dteare](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/8e7dd6/32.png) [@dteare](https://www.ruby-forum.com/u/dteare)\
**Post date:** [November 18, 2005, 7:20pm UTC](https://www.ruby-forum.com/t/rjs-templates/81456/2 "2005-11-18T19:20:21Z")

</div>

On Fri, Nov 18, 2005 at 01:17:17PM -0500, David Teare wrote:

> I’ve seen a couple of commits lately re: RJS templates. Where can I find  
> more info on what these are? Google came up empty ☹
> 
> > > Make rjs templates always implicitly skip out on layouts.

Hi David,

We’re going to be pushing out a demo video soon. Sit tight. Until then,  
read  
the rdoc and source!

## marcel

Marcel Molina Jr. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)

---

<div class="post-metadata">

**Author:** ![dteare](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/8e7dd6/32.png) [@dteare](https://www.ruby-forum.com/u/dteare)\
**Post date:** [November 18, 2005, 8:29pm UTC](https://www.ruby-forum.com/t/rjs-templates/81456/3 "2005-11-18T20:29:47Z")

</div>

On 18-nov-2005, at 19:25, Marcel Molina Jr. wrote:

> the rdoc and source!  
> wow  
> [http://dev.rubyonrails.org/changeset/3078](http://dev.rubyonrails.org/changeset/3078)  
> wicked cool

---

<div class="post-metadata">

**Author:** ![dteare](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/8e7dd6/32.png) [@dteare](https://www.ruby-forum.com/u/dteare)\
**Post date:** [November 18, 2005, 9:33pm UTC](https://www.ruby-forum.com/t/rjs-templates/81456/4 "2005-11-18T21:33:12Z")

</div>

Julian ‘Julik’ Tarkhanov wrote:

> > 
> 
> wicked cool  
> Ooo-er. I think my knees just went a bit wobbly.

---

<div class="post-metadata">

**Author:** ![dteare](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/8e7dd6/32.png) [@dteare](https://www.ruby-forum.com/u/dteare)\
**Post date:** [November 19, 2005, 12:22am UTC](https://www.ruby-forum.com/t/rjs-templates/81456/5 "2005-11-19T00:22:34Z")

</div>

First of all, wow!

Second, I got a small demo running using Rick’s example .rjs file and  
the rdocs, but I have a quick question. The docs say ‘When an .rjs  
action is called with +link\_to\_remote+, the generated JavaScript is  
automatically evaluated.’ However, I wasn’t able to get the scripts  
to run in the browser without adding :complete =\>  
‘eval(request.responseText)’ to my link\_to\_remote call, as Rick does  
in his view:  
[http://techno-weenie.net/svn/projects/rails\_help/app/views/questions/show.rhtml](http://techno-weenie.net/svn/projects/rails_help/app/views/questions/show.rhtml)

Is this the correct behaviour?

Thanks,

Cody

---

<div class="post-metadata">

**Author:** ![dteare](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/8e7dd6/32.png) [@dteare](https://www.ruby-forum.com/u/dteare)\
**Post date:** [November 18, 2005, 9:24pm UTC](https://www.ruby-forum.com/t/rjs-templates/81456/6 "2005-11-18T21:24:08Z")

</div>

> wow  
> [http://dev.rubyonrails.org/changeset/3078](http://dev.rubyonrails.org/changeset/3078)  
> wicked cool

Here’s a live example:  
[http://techno-weenie.net/svn/projects/rails\_help/app/views/questions/create.rjs](http://techno-weenie.net/svn/projects/rails_help/app/views/questions/create.rjs)

I’ll be moving the app to postgres later today so you can actually see  
it in action.

–  
rick  
[http://techno-weenie.net](http://techno-weenie.net)

---

<div class="post-metadata">

**Author:** ![dteare](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/8e7dd6/32.png) [@dteare](https://www.ruby-forum.com/u/dteare)\
**Post date:** [November 19, 2005, 12:25am UTC](https://www.ruby-forum.com/t/rjs-templates/81456/7 "2005-11-19T00:25:36Z")

</div>

On Fri, Nov 18, 2005 at 06:22:17PM -0500, Cody F. wrote:

> the rdocs, but I have a quick question. The docs say ‘When an .rjs  
> action is called with +link\_to\_remote+, the generated JavaScript is  
> automatically evaluated.’ However, I wasn’t able to get the scripts  
> to run in the browser without adding :complete =\>  
> ‘eval(request.responseText)’ to my link\_to\_remote call, as Rick does  
> in his view:  
> [http://techno-weenie.net/svn/projects/rails\_help/app/views/questions/show.rhtml](http://techno-weenie.net/svn/projects/rails_help/app/views/questions/show.rhtml)

This is true, but you need the latest version of prototype.js. If you  
are  
running on edge rails just do

svn up  
rake update\_javascripts

## marcel

Marcel Molina Jr. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)

---

<div class="post-metadata">

**Author:** ![dteare](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/8e7dd6/32.png) [@dteare](https://www.ruby-forum.com/u/dteare)\
**Post date:** [November 19, 2005, 12:40am UTC](https://www.ruby-forum.com/t/rjs-templates/81456/8 "2005-11-19T00:40:42Z")

</div>

What about RCSS templates? 🙂

I have dynamic stylesheets going on at the moment, and have noticed that  
Basecamp even has this going on in the background.

Would be cool to see, in addition to the new JS type to the template  
schema.

Warmest regards,  
Nathan.

* * *

Nathaniel S. H. Brown Toll Free 1.877.4.INIMIT  
Inimit Innovations Phone 604.724.6624  
[www.inimit.com](http://www.inimit.com) Fax 604.444.9942
