Skip to content

Commit

Permalink
Inline deprecated--init controller in resource_turbo_frame helper
Browse files Browse the repository at this point in the history
  • Loading branch information
spohlenz committed Aug 4, 2024
1 parent 295b4ec commit 13dcabe
Showing 1 changed file with 1 addition and 7 deletions.
8 changes: 1 addition & 7 deletions app/helpers/trestle/turbo_frame_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -17,17 +17,11 @@ def resource_turbo_frame(instance, options={}, &block)
id: dom_id(instance),
target: ("_top" unless modal_request?),
data: {
controller: resource_turbo_frame_controllers.join(" ").presence
controller: ("deprecated--init" if modal_request? || request.post? || turbo_frame_request?)
}
}

content_tag("turbo-frame", defaults.merge(options), &block)
end

def resource_turbo_frame_controllers
controllers = []
controllers << "deprecated--init" if modal_request? || request.post? || turbo_frame_request?
controllers
end
end
end

0 comments on commit 13dcabe

Please sign in to comment.