title: How the rails select box selected option is giving from coffee file
body: <p>In a js.coffee file after an ajax success, i need to put values to a select box with selected a particular name.</p>
  
  <p><strong>_form.html,erb</strong> :</p>
  
  <pre><code>&lt;%= f.select(:user_id, Item.find(session[:login_users_item_id]).try(:users).order_by_fullname.collect {|u| [ u.full_name, u.id ] }, selected: current_user.id)%&gt;
  </code></pre>
  
  <p><strong>items.js.coffee</strong>:</p>
  
  <pre><code>$.ajax '/users.json',   
  type: 'GET', data: {"from_prod_bu" : selecteditemId},
  success: (data) -&gt;
    userSelectBox = $('#prod_user_id')
    userSelectBox.html('')
    if data.length == 0
      userSelectBox.append($('&lt;option&gt;').text('').attr('value', ''))
    else
      $.each data, (index,el) -&gt;
        userSelectBox.append($('&lt;option&gt;').text(el.firstname+' '+el.lastname).attr('value', el.id))
  </code></pre>
  
  <p>Now, the user fullname is listing in the select box, but how can i give the selected option for displaying a particular username .</p>
  
  <p>Thanks</p>