Detect platform and label the correct hotkey shortcut

Yes, Platform Agent is overkill for just this but there isn't a one-size JS solution for updating both input placeholders and other HTML text and we're likely to need it later for other things like displaying platform-specific PWA prompts.
This commit is contained in:
Jason Zimdars
2025-05-27 12:14:24 -05:00
parent c2c3a8d8ab
commit d17134cb5c
9 changed files with 72 additions and 7 deletions
+12
View File
@@ -0,0 +1,12 @@
module SetPlatform
extend ActiveSupport::Concern
included do
helper_method :platform
end
private
def platform
@platform ||= ApplicationPlatform.new(request.user_agent)
end
end