Move table actions partial to a component

This partial was going to get too complex since in some places we've got
different texts, different URLs or different confirmation messages.
While we should probably try to be more consistent and that would make
the partial work in most cases, there'll always be some exceptions, and
using a partial (with, perhaps, some helper methods) will become messy
really quickly.
This commit is contained in:
Javi Martín
2020-06-09 00:47:41 +02:00
parent baefc249f0
commit 10c095d821
25 changed files with 59 additions and 22 deletions

View File

@@ -0,0 +1,8 @@
class Admin::TableActionsComponent < ApplicationComponent
attr_reader :record, :actions
def initialize(record, actions: [:edit, :destroy])
@record = record
@actions = actions
end
end