DEV Community

Discussion on: How to render to different DOM structures in Rails based on view port

Collapse
 
ben profile image
Ben Halpern

The answer might depend somewhat on your constraints in the project.

Are you allowed to tackle the issue on the server by asking if request.user_agent matches the correct devices?

Are you allowed to render the ID or even the whole section to the page with JavaScript on the client?

The scenario you've outlined here strikes me as less than ideal, so definitely knowing what tools you're allowed to use to solve it would be my first thought.