.col-sm-1#affixed{ data: { spy: 'affix' } }
  = link_to "Back to Top", '#', id: 'back_to_top'

:javascript
  $('#affixed').affix({
    offset: {
      top: $(window).height() * 0.1
    }
  });
  
  $('#back_to_top').click(function() {
    $('html, body').animate({ scrollTop: 0 }, 'fast');
  });

.col-sm-1#affixed{ data: { spy: 'affix' } }
  %button.btn.btn-primary{ type: 'button', id: 'back_to_top' }
    Back to Top

:javascript
  $('#affixed').affix({
    offset: {
      top: $(window).height() * 0.1
    }
  });
  
  $('#back_to_top').click(function() {
    $('html, body').animate({ scrollTop: 0 }, 'fast');
  });

Change back to top styling to a button
Change back to top styling to a button
