I have two models: Child and Day. A Child has many days, and a day
belongs to a child.
I want to create ana ajax table listing the children and, after pressing
a button, I want to show the days that belong to that child.
Here is my code:
|<%= link_to 'Days', :action => 'show_days', :id => child %>|
@child = Child.find(params[:id])
@days = @child.days
page.replace_html ‘show_days’, :partial => ‘days’, :collection => @days
page.visual_effect :toggle_appear, ‘show_days’, ‘duration’ => 0.5
<% for day in @days -%>
The problem is, in Firefox I get a new page with the following text:
What am I doing wrong?