RJS confirmation popup

Hi everyone,

In my app users can save queries. I want to warn them if they are
about to overwrite an existing query (same name). I wanted to do this
with a confirm javascript popup.

My question is: Is it possible to generate a confirmation popup from
an RJS template and then somehow get the answer back? To know if my
controller should overwrite the query or just discard the changes.

Up until now, I didn’t find a way to generate a confirmation popup
through RJS, except with the call method to call a javascript method
that will generate this for me…but I was hoping for something a bit
more ruby…and it doesn’t solve the problem of getting the answer back
to the controller.

Thank you,


Do the pop-up before the Ajax post

:confirm => ‘Are you sure you want to save this?’

I’m assuming that you can easily check for existing queries when this
loads and make the confirm conditional.


This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs