# Problems with render :update in controller on winXP

**URL:** <https://www.ruby-forum.com/t/problems-with-render-update-in-controller-on-winxp/139098>\
**Category:** Rails\
**Created:** [May 30, 2008, 7:05pm UTC](https://www.ruby-forum.com/t/problems-with-render-update-in-controller-on-winxp/139098 "2008-05-30T19:05:29Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![casper\_the\_ghost](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/58956e/32.png) [@casper\_the\_ghost](https://www.ruby-forum.com/u/casper_the_ghost)\
**Post date:** [May 30, 2008, 7:05pm UTC](https://www.ruby-forum.com/t/problems-with-render-update-in-controller-on-winxp/139098/1 "2008-05-30T19:05:29Z")

</div>

1.8.6, Rails 2.0.2 on winxp. using webrick.

When I attempt to render RJS inline in the controller using  
render :update, it fails horribly. none of the prototype helpers  
work; each spits out the generated javascript to the screen. If i  
call the same prototype function in a script tag in the view, sans  
RJS, it works perfectly. I’ve ran rake to update the js and verified  
the versions by hand, and starting now to trace this back through the  
rails source. The only output to the client is the javascript; it  
even has the correct content type in the headers.

could this be a bug somehow with the windows one-click packages? i  
didn’t have any issues on my mac with 1.8.6 and 2.0.2. I know RJS is  
finicky with syntax errors - this is a very isolated and standard  
example on a new rails project. none of my RoR 1.2 code imported at  
all from older projects, which were heavy on inline RJS.  
Appreciate any insight.

#controller  
class HomeController \< ApplicationController

def index  
render :update do |page|  
page.insert\_html :top, ‘test’ , “

- this list
”  
end  
end

#view

#layout

 \<%= stylesheet\_link\_tag 'home' %\> \<%= javascript\_include\_tag :defaults %\> \<%= yield :layout %\>
* * *

cheers  
-isaac

---

<div class="post-metadata">

**Author:** ![casper\_the\_ghost](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/58956e/32.png) [@casper\_the\_ghost](https://www.ruby-forum.com/u/casper_the_ghost)\
**Post date:** [May 31, 2008, 7:54pm UTC](https://www.ruby-forum.com/t/problems-with-render-update-in-controller-on-winxp/139098/2 "2008-05-31T19:54:54Z")

</div>

On 30 May 2008, at 18:04, removed\_email\_address@domain.invalid wrote:

> even has the correct content type in the headers.
> 
> could this be a bug somehow with the windows one-click packages? i  
> didn’t have any issues on my mac with 1.8.6 and 2.0.2. I know RJS is  
> finicky with syntax errors - this is a very isolated and standard  
> example on a new rails project. none of my RoR 1.2 code imported at  
> all from older projects, which were heavy on inline RJS.  
> Appreciate any insight.

Are you just going to home/index ? In which case it’s normal that the  
rjs is just dumped in the view - it’s only ever going to be executed  
if the request was made by link\_to\_remote, remote\_form\_for etc…  
If you want to generate a script tag then use javascript\_tag (you can  
use update\_page to generate the actual javascript)

Fred
