I have an android/ios app built with hotwire adapter (based on the demo app). How can I serve different views for it from my web app? I want to make sure that the views for the browser on mobile browser is different to the views served to my mobile app.
Some pseudo-code for this idea might look like:
class ApplicationController < ActionController::Base before_action :determine_variant private def determine_variant request.variant = :ios if request.user_agent.includes?("Turbo Native iOS") end end
If you’re not on Rails, the same idea of switching on the user agent string would still be possible.