title: Meteor: Where to place $('#modal').modal() call to automatically show the same modal on many routes?
body: <p>I am developing an application with Meteor. On several pages I want to programmatically show a bootstrap-3 modal when the user navigates to that page. The modal will give instructions for how to use respective page. The user has the possibility to disable this behaviour.</p>
  
  <p>After reading this <a href="https://stackoverflow.com/questions/28626064/meteor-execute-jquery-code-on-every-change">Meteor: execute jQuery code on every &quot;change&quot;</a> I thought the best way to do this is in iron-router's hooks.</p>
  
  <pre><code>StepController = RouteController.extend({
    onAfterAction: function() {
      var userSettings = Meteor.user().profile.settings;
      if(userSettings.showHelp) {
        $('#modal').modal();
      }
    }
  });
  </code></pre>
  
  <p>The modal shows, but it renders the page unusable, as the modal doesn't respond to any attempts to close it.</p>
  
  <p>In the comments I read that the router shouldn't be used for anything but routing the user and related security checks.</p>
  
  <p>So all in all suggested places I found on Stack Overflow  to put the modal call are:</p>
  
  <ul>
  <li>Iron Router hooks</li>
  <li>template helper </li>
  <li>template rendered hook</li>
  </ul>
  
  <p>To be honest I am confused. I would very much appreciate some teaching regarding the concepts and best practices around this.</p>