Here is a snippet of my code for a bootstrap enabled simple_form partial which is rendered from both new.html.haml and edit.html.haml:
.well
= simple_form_for @scenario, :html => { :class => 'scenario_form' } do |f|
%fieldset#economics
%legend Economics
.row
.span4
= f.input :pdeck_id, :collection => @pdecks.map { |p| [
p.name,
p.id] }, :label => "Price Deck"
.span4
= link_to 'Display a Bootstrap Modal for the selected pdeck_id when clicked', :class => 'btn', :remote => true, :id => ???
.row
.span4
= submit_tag 'Save', :class => 'btn btn-primary'
I need to get hold of the price deck id (pdeck_id above in my code) when the link is clicked in BOTH the new and edit actions, so that I can then activate a remote bootstrap popup showing all the details for that price deck. The reason this is necessary is that just the price deck name is not enough for the user. They need to be able to see the other details for the selected Price Deck so that they know that the correct deck is being selected. I would like to make this a 'remote' link and be able to pass in the selected pdeck_id with the id attribute.
Appreciate any help in advance.
Bharat