Skip to content

Commit 08e6ccc

Browse files
committed
remote ajax call for removing tags
1 parent a243e18 commit 08e6ccc

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

app/controllers/page_tags_controller.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,13 +11,13 @@ def remove
1111
user_id: current_user.id
1212
).destroy_all
1313

14-
return redirect_back fallback_location: root_path, notice: 'Tag deleted successfully.'
14+
return redirect_back fallback_location: root_path, notice: 'Tag(s) deleted successfully.'
1515
end
1616

1717
# Destroy a specific tag by ID
1818
def destroy
1919
PageTag.find_by(id: params[:id], user_id: current_user.id).destroy!
2020

21-
return redirect_back fallback_location: root_path, notice: 'Tag deleted successfully.'
21+
return redirect_back fallback_location: root_path, notice: 'Tag(s) deleted successfully.'
2222
end
2323
end

app/views/data/tags.html.erb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@
6262
<em>Loading <%= content_type.name %> name...</em>
6363
</span>
6464
<% end %>
65-
<%= link_to destroy_specific_tag_path(page_tag), method: :delete, class: 'tooltipped', data: { tooltip: 'Remove this tag' } do %>
65+
<%= link_to destroy_specific_tag_path(page_tag), method: :delete, class: 'tooltipped', data: { tooltip: 'Remove this tag' }, remote: true do %>
6666
<i class="close material-icons">close</i>
6767
<% end %>
6868
</div>

0 commit comments

Comments
 (0)