I have a table that displays all of a users Teacher models. I want the rightmost column of the table to contain 'edit' buttons that cause a bootstrap modal to appear with a form that submits to that models edit path.
So far I have a table with buttons whose id's correspond to the id's of the model they are displaying. When the buttons are clicked, the modal appears, but the form always submits to the same url. I'm having trouble finding a way to change the url that the form submits to based on the id of the button that was pressed.
Button:
<a id="edit-#{teacher_id_here}" href="#myModal" role="button" class="btn" data-toggle="modal">
Launch demo modal
</a>
Modal:
<div id="myModal" class="modal hide fade" tabindex="-1" role="dialog"
aria-labelledby="myModalLabel" aria-hidden="true">
...
</div>