Here is my setup: I don''t know how to use HTML on these groups, but
find my code below.
<code>
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
</code>
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.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Ruby on Rails: Talk" group.
To post to this group, send email to
rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
To unsubscribe from this group, send email to
rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---