title: Pass boolean from rails controller to javascript for use in conditional
body: <p>I have a form in a bootstrap modal that is being processed using ajax. If the form validates it closes the modal or shows the validation errors as expected. However, I would like to redirect the user after the modal hide animation is finished if a condition is met based on a boolean held in the controller. Although the conditional wouldn't work as written, it lets you see what it is I am trying to accomplish:</p>
  
  <pre><code>$(document).ready(function() {
    $('#modal-window').modal({remote: true});
    $('#modal-window').modal('show');
    $('#modal-window').on('hidden', function(){
      var saved = &lt;%= @bool %&gt;;
      if(saved == "true"){
        $(window.location.replace("&lt;%= some_url %&gt;"));}
      });
  })
  </code></pre>