<script>
var counter = 0;
$(document).ready(function() {
var $output = $('#output');
$('#increment').click(function() {
counter++;
$output.html(counter);
});
$output.html(counter);
});
</script>
with <script>
var counter = 0;
$(document).on('click', '#increment', function() {
counter++;
$('#output').html(counter);
});
</script>
Then this line is generated `add_reference :things, :this, foreign_key: true`
and then we call the migration, and there is the foreign key.