# Newbie question about "render :update do |page|"

**URL:** <https://www.ruby-forum.com/t/newbie-question-about-render-update-do-page/112580>\
**Category:** Rails\
**Created:** [August 21, 2007, 3:05am UTC](https://www.ruby-forum.com/t/newbie-question-about-render-update-do-page/112580 "2007-08-21T03:05:25Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![enduro](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/e/5f8ce5/32.png) [@enduro](https://www.ruby-forum.com/u/enduro)\
**Post date:** [August 21, 2007, 3:05am UTC](https://www.ruby-forum.com/t/newbie-question-about-render-update-do-page/112580/1 "2007-08-21T03:05:25Z")

</div>

Hi Railies

I’m somewhat stuck trying to add some AJAX to my app, AJAX newbie stuff  
I guess:

View:

list

form
\<%= link\_to\_remote 'GO', :update =\> 'ajax\_form', :url =\> { :action =\> 'test' } %\>

Controller:  
def test  
render :update do |page|  
page.replace\_html ‘ajax\_list’, ‘just testing’  
page.replace\_html ‘ajax\_form’, ‘here too’  
end  
end

When I hit the GO link, I get this output dumped in the ajax\_form-div:

NoMethodError in CompanyController#test  
undefined method `+' for #<Mime::Type:0x25cc57c> #{RAILS_ROOT}/app/controllers/application.rb:164:in`set\_charset’  
(…)

My code does look wrong to me, too, with ajax\_form appearing in both  
link\_to\_remote and replace\_html. But I don’t seem to be able to figure  
out the right way to do it.

Big thanks for your help!!

---

<div class="post-metadata">

**Author:** ![enduro](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/e/5f8ce5/32.png) [@enduro](https://www.ruby-forum.com/u/enduro)\
**Post date:** [August 21, 2007, 12:00pm UTC](https://www.ruby-forum.com/t/newbie-question-about-render-update-do-page/112580/2 "2007-08-21T12:00:12Z")

</div>

Fixed it, an application helper that altered headers caused the issue.

---

<div class="post-metadata">

**Author:** ![enduro](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/e/5f8ce5/32.png) [@enduro](https://www.ruby-forum.com/u/enduro)\
**Post date:** [August 21, 2007, 6:06pm UTC](https://www.ruby-forum.com/t/newbie-question-about-render-update-do-page/112580/3 "2007-08-21T18:06:09Z")

</div>

Not sure if this was part of the fix or not, but don’t mix the use of  
the :update option in the remote call with a render :update. You’ll  
end up with js rendered into your target element.

On Aug 21, 6:00 am, Sven S. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)
