title: Passing a rails model attibute value to radio buttons in a JQuery modal
body: <p>Hi there StackOverflowers, I am trying to set one of a series of 6 available options in an "upgrade" modal. In this scenario, the user has already selected and option, so the radio <em>should</em> already have and assigned value (when it is opened) that comes from the rails model. Does that make sense?  Anyway, I can seem to write the jquery to set the correct radio button based on the option that has already been selected in a previous transaction. For example, I am working with turnaround times. The customer must select a turn around time in their initial transaction, but may upgrade later, using the ui that has this modal. </p>
  
  <p>Here is the javascript I've got, but it's breaking the functionallity of the site. I know it must be one simple error, but I can't see it. This works without the "if" statement and I am getting an "Uncaught SyntaxError: Unexpected identifier" on the "if" statement. When I look at the button DOM element by right clicking on it in the browser, this button is receiving the correct value as <em>part</em> of its id. I am only concerned about one very specific part of the button id, so I am using (id*="3"). I know model attributes can be accessed from the modal with backbone, but we're not using it, unfortunately. </p>
  
  <p>help? </p>
  
  <pre><code>    $(function showTargethrs() {
      if $('button[id*='_3']') {
        $('#li_3hr').addClass("active");
        $('#updateTarget_3').prop('checked', true);
        }
      });
  </code></pre>