Answer the question
In order to leave comments, you need to log in
How to make a link to bulk change columns in rails?
Hello everyone, there are notifications for users
<div class="notification">
<h4>Уведомления</h4>
<% @activities.each do |activity| %>
<ul>
<li>
<%= render "activities/#{activity.trackable_type.underscore}/#{activity.action}", activity: activity %>
</li>
</ul>
<% end %>
<%= link_to "отменить всё как прочитано"%>
</div>
Answer the question
In order to leave comments, you need to log in
1. we collect all id of these events into one array, for example activities[]
2. we send it via ajax serialize
3. we get this array in the controller
activities = Activity.find(params[:activities])
activities.each do |activity|
activity.mark_as_read!
end
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question