Reputation: 1456
How can I clear cache in rails 4.2. My html.erb contain
<% @datas.each_with_index do |data, i| %>
<% cache data do %>
<tr class="">
<td><%= i + 1 %></td>
<td><%= data.value %></td>
</tr>
<% end %>
<% end %>
Now the problem is that on adding new data my
<td><%= i + 1 %></td>
count does not increase that is before adding data count shows 1,2,3,4
and after adding data count shows 1,1,2,3,4
. Now the second problem is my /tmp/cache
files are increasing regularly. Now How can I expire unused cache on adding and updating data.
Upvotes: 0
Views: 247