Skip to content

Commit 407a2e3

Browse files
authored
feat: accept meta tag string arguments as well
1 parent 30cd8fc commit 407a2e3

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

app/helpers/turbo/drive_helper.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -74,13 +74,13 @@ def turbo_refreshes_with(method: :replace, scroll: :reset)
7474

7575
# Configure method to perform page refreshes. See +turbo_refreshes_with+.
7676
def turbo_refresh_method_tag(method = :replace)
77-
raise ArgumentError, "Invalid refresh option '#{method}'" unless method.in?(%i[ replace morph ])
77+
raise ArgumentError, "Invalid refresh option '#{method}'" unless method.to_i.in?(%i[ replace morph ])
7878
tag.meta(name: "turbo-refresh-method", content: method)
7979
end
8080

8181
# Configure scroll strategy for page refreshes. See +turbo_refreshes_with+.
8282
def turbo_refresh_scroll_tag(scroll = :reset)
83-
raise ArgumentError, "Invalid scroll option '#{scroll}'" unless scroll.in?(%i[ reset preserve ])
83+
raise ArgumentError, "Invalid scroll option '#{scroll}'" unless scroll.to_i.in?(%i[ reset preserve ])
8484
tag.meta(name: "turbo-refresh-scroll", content: scroll)
8585
end
8686
end

0 commit comments

Comments
 (0)