I have a simple_form_for tag on my page which should sometimes be disabled based on certain conditions (whether or not an API call comes back successfully). I am trying to stick to a turbo frames method for rendering this page; if the API call is successful, it builds a model using data from the API call and passes it to the turbo frame and renders it. My app does not use a database, all data is stored remotely.
When the call comes back unsuccessfully, I want to render the same simple form, but have everything greyed out and unusable, just so that the user can still see what would normally be there and to keep the UI consistent. I could just do this with some stimulus disable tags but this still leaves it so that the user could potentially re-enable things in the browser and attempt to submit the form. I would rather just render a template in the backend with a fake form that cannot be submitted at all. Is there an easy way to do this (preferably without introducing a whole separate model)?
As I said, I know how to do this via JS, but would like to do this through the rails backend instead and use simple form's native functionality. I looked in the docs, but couldn't find an obvious way to render a dummy form with the same fields as the functional form.