app/components/avo/actions_component.rb in avo-2.11.3.pre.1 vs app/components/avo/actions_component.rb in avo-2.11.3.pre.2
- old
+ new
@@ -1,26 +1,17 @@
# frozen_string_literal: true
class Avo::ActionsComponent < ViewComponent::Base
include Avo::ApplicationHelper
- def initialize(actions: [], resource: nil, view: nil, exclude: [], style: :outline, color: :blue)
- @actions = actions || []
+ def initialize(actions: [], resource: nil, view: nil)
+ @actions = actions
@resource = resource
@view = view
- @exclude = exclude
- @color = color
- @style = style
end
def render?
- actions.present?
- end
-
- def actions
- @actions.select do |action|
- !action.class.in?(@exclude)
- end
+ @actions.present?
end
# When running an action for one record we should do it on a special path.
# We do that so we get the `model` param inside the action so we can prefill fields.
def action_path(id)