Skip to content

Commit

Permalink
Refactor - rename method
Browse files Browse the repository at this point in the history
  • Loading branch information
bryszard committed Nov 18, 2023
1 parent 9863626 commit 8b0b325
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions app/components/avo/field_wrapper_component.rb
Original file line number Diff line number Diff line change
Expand Up @@ -84,11 +84,11 @@ def data

# Add the built-in stimulus integration data tags.
if @resource.present?
add_stimulus_controllers_for(@resource, attributes)
add_stimulus_attributes_for(@resource, attributes)
end

if @action.present?
add_stimulus_controllers_for(@action, attributes)
add_stimulus_attributes_for(@action, attributes)
end

# Fetch the data attributes off the html option
Expand Down Expand Up @@ -121,7 +121,7 @@ def full_width?

private

def add_stimulus_controllers_for(entity, attributes)
def add_stimulus_attributes_for(entity, attributes)
entity.get_stimulus_controllers.split(" ").each do |controller|
attributes["#{controller}-target"] = "#{@field.id.to_s.underscore}_#{@field.type.to_s.underscore}_wrapper".camelize(:lower)
end
Expand Down

0 comments on commit 8b0b325

Please sign in to comment.