Module: Trestle::Turbo::FrameHelper
- Defined in:
- app/helpers/trestle/turbo/frame_helper.rb
Instance Method Summary collapse
- #index_turbo_frame(options = {}, &block) ⇒ Object
- #resource_turbo_frame(instance, options = {}, &block) ⇒ Object
Instance Method Details
#index_turbo_frame(options = {}, &block) ⇒ Object
4 5 6 7 8 9 10 11 12 13 14 |
# File 'app/helpers/trestle/turbo/frame_helper.rb', line 4 def index_turbo_frame(={}, &block) defaults = { id: "index", data: { controller: "reloadable", turbo_action: "advance" } } content_tag("turbo-frame", defaults.merge(), &block) end |
#resource_turbo_frame(instance, options = {}, &block) ⇒ Object
16 17 18 19 20 21 22 23 24 25 26 |
# File 'app/helpers/trestle/turbo/frame_helper.rb', line 16 def resource_turbo_frame(instance, ={}, &block) defaults = { id: dom_id(instance), target: ("_top" unless modal_request?), data: { controller: ("deprecated--init" if modal_request? || request.post? || turbo_frame_request?) } } content_tag("turbo-frame", defaults.merge(), &block) end |