I have a portion of my app that sometimes will need to inform the user of their action, but the app does not know of the requirement to inform the user until after the form has been submitted (which eliminates Javascript).
Basically what happens is that the user uploads one or more files containing records, if the number of records within the files is greater than X, then I have to determine a sample size and only use that number of the articles, the articles that get selected are randomly chosen. The problem I have is that it is possible for the user to upload files on the create action, as well as the edit action. So previously a user could have uploaded 2 files that never reached a record count greater than X, and on a recent edit they did - and now we need to create a sample set.
This isn't a big issue, but because they have created articles in the past, we now need to delete SOME of the records from the previous files, because we are creating a sample set - so I need to inform the user of what is about to happen.
So, once the user clicks submit, I determine the number of records in the file, and if its greater than X I need to show a message and the user has to click continue or cancel (Ideally I could just render a view here so that I can provide nice, styled information to the user). If its less than X then I don't care and just continue.