Skip to content

Commit

Permalink
Add turbo 8 meta helpers (phlex-ruby#186)
Browse files Browse the repository at this point in the history
  • Loading branch information
BarnabeD committed Mar 29, 2024
1 parent e656341 commit 58f4119
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 0 deletions.
2 changes: 2 additions & 0 deletions lib/phlex/rails/helpers.rb
Original file line number Diff line number Diff line change
Expand Up @@ -173,6 +173,8 @@ module Phlex::Rails::Helpers
autoload :Truncate, "phlex/rails/helpers/truncate"
autoload :TurboFrameTag, "phlex/rails/helpers/turbo_frame_tag"
autoload :TurboIncludeTags, "phlex/rails/helpers/turbo_include_tags"
autoload :TurboRefreshMethodTag, "phlex/rails/helpers/turbo_refresh_method_tag"
autoload :TurboRefreshScrollTag, "phlex/rails/helpers/turbo_refresh_scroll_tag"
autoload :TurboStream, "phlex/rails/helpers/turbo_stream"
autoload :TurboStreamFrom, "phlex/rails/helpers/turbo_stream_from"
autoload :URLField, "phlex/rails/helpers/url_field"
Expand Down
8 changes: 8 additions & 0 deletions lib/phlex/rails/helpers/turbo_refresh_method_tag.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# frozen_string_literal: true

module Phlex::Rails::Helpers::TurboRefreshMethodTag
extend Phlex::Rails::HelperMacros

# @!method turbo_refresh_method_tag(...)
register_output_helper :turbo_refresh_method_tag
end
8 changes: 8 additions & 0 deletions lib/phlex/rails/helpers/turbo_refresh_scroll_tag.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# frozen_string_literal: true

module Phlex::Rails::Helpers::TurboRefreshScrollTag
extend Phlex::Rails::HelperMacros

# @!method turbo_refresh_scroll_tag(...)
register_output_helper :turbo_refresh_scroll_tag
end
2 changes: 2 additions & 0 deletions lib/phlex/rails/layout.rb
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ module Layout
include Helpers::JavascriptIncludeTag
include Helpers::JavascriptImportmapTags
include Helpers::JavascriptImportModuleTag
include Helpers::TurboRefreshMethodTag
include Helpers::TurboRefreshScrollTag

# @api private
module Interface
Expand Down

0 comments on commit 58f4119

Please sign in to comment.