How can I populate a div with Rails code when a link is clicked?

inezcaribbean

New Member
I'm trying to populate some li tags with this code: \[code\]<%= @events.each do |event| %><li><span class="eventname">event.name</span><span class="eventlocation">event.location</span></li><% end %>\[/code\]And I have some links that say "today", "tomorrow" etc and when I hit today I want the events from today to show up. If I hit tomorrow I want tomorrow's to show up. I've looked everywhere through AJAX tutorials and javascript tutorials and I'm completely lost on how to do this in rails. One way I considered doing is having this block of code be a partial, and change it slightly for each partial so that the specific events that I want to show come up. But then I'm still stuck with the same problem, I'm not sure how to show a specific partial based on the click of a link.
 
Back
Top