Topic: Ajax update not happening

How do i update a portion of a page using Ajax in rails 2.3.8?

i am trying to make a calendar with buttons to go to next and previous months. At the click of the buttons i want the calendar to change without reloading the whole page.

On of my buttons to scroll through months look like this:

        <%= link_to_remote "<",:update=>'calendar',:url=>{:action=>'ajax_calendar',:month => (@date.beginning_of_month-1).strftime("%Y-%m")} %>

This is my main page where i have rendered the partial.   

        <div id="calendar">
            <%= render :partial=>'calendar' %>

when i tried to debug with firebug the ajax call is getting executed correctly and i am also getting the correct response from the server but the id 'calender' is not getting updated.

Can somebody please point out what i am doing wrong?

Thanks in advance.

Last edited by ejohn (2010-11-13 08:09:05)

Re: Ajax update not happening

I do not know if 2.3.8 is the same as Rails 3, but in Rails 3 I have an index.js.erb file in the same view as your index.html.erb which updates my div "testsearch"

$('testsearch').update("<%= escape_javascript(render :partial => 'homepage') %>");

in your case it would be "calender" and your partial _calender

Re: Ajax update not happening

my mistake. this is a problem caused by using jquery and prototype together. thanks for taking your time to help.

Last edited by ejohn (2010-11-14 08:55:19)