# Remote call help

**URL:** <https://www.ruby-forum.com/t/remote-call-help/121561>\
**Category:** Rails\
**Created:** [November 28, 2007, 10:53pm UTC](https://www.ruby-forum.com/t/remote-call-help/121561 "2007-11-28T22:53:14Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![anthony](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/49beb7/32.png) [@anthony](https://www.ruby-forum.com/u/anthony)\
**Post date:** [November 28, 2007, 10:53pm UTC](https://www.ruby-forum.com/t/remote-call-help/121561/1 "2007-11-28T22:53:14Z")

</div>

Here is my setup: I don’t know how to use HTML on these groups, but  
find my code below.

`
def change_calendar
    @school = School.find_by_name(params[:school])
    @events = Event.find(:all, :conditions => ['school_id = ?',
@school.id], :order => 'date')
    @upcomingEvents = @events.first(4)
    @eventList = []
    @eventIdList = []
    @events.each do |f| #Create a list of dates to update the
calendar
      if ! @eventList.nil?
         @eventList.push(f.date.to_date)
         @eventIdList.push(f.id)
      end
    end
    render(:update) do |page|
      page.call 'toggleTab', 'a', @school.id, 3, 3, 0
      page.replace_html 'miniCalendar2', '<%= put_calendar("Belle
Meade") %>'
    end
  end
`

If you will look at the page.replace\_html line, you’ll see what I am  
having problems with. There is a put\_calendar helper that i use to  
generate a calendar. When the page initially loads, it’s fine. But,  
when I call this function to replace the calendar with a new one  
holding the events only for a new school, it doesn’t do anything. I am  
assuming that is because helpers only load the first time and you  
can’t call them dynamically? what would be another way to do this?

Thank you in advance for your help.
