using Javascript's prompt() and render_component to make one Rails action interactive

  I'm trying to use a combination of render_component and Javascript's
prompt() to make one Rails action interactive. This means I could ask
for input via Javascript and then pass the Javascript answer to some
Ruby code. Is this possible?
For example: