Is it possible to create a QR code that redirects the user to a modal in a specific page? As in, you send him to the page X but already trigger click <%= link_to "modaltoshow %> , and the user sees the modal immediately after scanning.
Thanks
Is it possible to create a QR code that redirects the user to a modal in a specific page? As in, you send him to the page X but already trigger click <%= link_to "modaltoshow %> , and the user sees the modal immediately after scanning.
Thanks
If your question is simply "can I launch a page with a modal already open," the answer is yes. You'd just need a javascript that launches it on load, like the selected answer here.
Assuming you need some ruby logic, you could simply change the target of that script with embedded ruby based upon a parameter the QR code passes (for instance, if you have a parameter "target_modal" that is the target modal's id, just reference that in the script). It could look something like this in your script block:
<!-- The if statement just checks for the parameter. If the parameter will
always be present, you may remove this. -->
<% if params(:target_modal) %>
$(window).load(function(){
$('<%= params(:target_modal) %>').modal('show');
});
<% end %>