Extract helper instead of using anemic partial
This commit is contained in:
@@ -7,6 +7,12 @@ module CollectionsHelper
|
||||
end
|
||||
end
|
||||
|
||||
def link_to_edit_collection(collection)
|
||||
link_to edit_collection_path(collection), class: "btn", data: { controller: "tooltip" } do
|
||||
icon_tag("settings") + tag.span("Settings for #{collection.name}", class: "for-screen-reader")
|
||||
end
|
||||
end
|
||||
|
||||
def referenced_collections_from(records)
|
||||
Current.user.collections.where id: records.pluck(:collection_id).uniq
|
||||
end
|
||||
|
||||
@@ -1,4 +0,0 @@
|
||||
<%= link_to edit_collection_path(collection), class: "btn", data: { controller: "tooltip" } do %>
|
||||
<%= icon_tag "settings" %>
|
||||
<span class="for-screen-reader">Settings for <%= collection.name %></span>
|
||||
<% end %>
|
||||
@@ -18,7 +18,7 @@
|
||||
|
||||
<div class="header__actions header__actions--end">
|
||||
<% if collection = @filter.single_collection %>
|
||||
<%= render "cards/collection_settings", collection: collection %>
|
||||
<%= link_to_edit_collection collection %>
|
||||
<% end %>
|
||||
</div>
|
||||
<% end %>
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
</h1>
|
||||
|
||||
<div class="header__actions header__actions--end">
|
||||
<%= render "cards/collection_settings", collection: @collection %>
|
||||
<%= link_to_edit_collection @collection %>
|
||||
</div>
|
||||
<% end %>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user