I have this piece of code in view
<% cache("students_cache") do %>
<% @swimming_students.each do |swimming_student| %>
<tr class="gradeX">
<td><%= link_to " #{swimming_student.full_name}", swimming_student %></td>
<td><%= swimming_student.homephone %></td>
</tr>
<% end %>
<% end %>
And I have the expire code in anther action
def create
expire_fragment("students_cache")
@swimming_student = Swimming::Student.new(params[:swimming_student])
respond_to do |format|
if @swimming_student.save
format.html { redirect_to @swimming_student, notice: 'Student was successfully created.' }
format.json { render json: @swimming_student, status: :created, location: @swimming_student }
else
format.html { render action: "new" }
format.json { render json: @swimming_student.errors, status: :unprocessable_entity }
end
end
end
But after I created a new student the cache was not updated.
Something is missing?