If you want to render a partial I suppose you want to call the controller through AJAX. I would solve this by adding remote: true
to the links representing the three choices, and setting up the actions in the controller accordingly.
For instance:
<%= link_to 'choice 1', choice_path, class:'choice-link', data: { choice: 1 }, remote: true %>
.
# controller
def choice_action
# some filter based on which choice (1, 2 or 3) the user chose
render partial: 'path/to/partial', layout: false if request.xhr?
end
The layout
flag indicates that you just return the HTML generated by the partial, and do not wrap it in the application layout you normally would when rendering server-generated HTML templates.
In order to append the HTML to your DOM I'd use a listener on the choice links, for instance like so:
$('.choice-link').on 'ajax:success', (data, status, xhr) ->
$('#popup').html(data)