title: rails - disable select tag
body: <p>I am trying to disable a select tag. The options to fill our not database attributes but rather an array of integers, so collection_select doesn't seem to work in this situation.</p>
  
  <p>technique 1:</p>
  
  <pre><code>select_tag(:zev_qty, options_for_select(display_quantity(@order_subject_supplies_request.site), {:disabled =&gt; display_quantity(@order_subject_supplies_request.site)}))
  
  def display_quantity(site)
    if site
      site.open_site? ? [[0,0],[1,1],[2,2]] : [[0,0],[1,1]]
    else
      []
    end
  end
  </code></pre>
  
  <p>The above is not what I want. It disables the options not the select tag.</p>
  
  <p>technique 2:</p>
  
  <pre><code>f.select(:zev_qty, display_quantity(@order_subject_supplies_request.site), {:disabled =&gt; true})
    def display_quantity(site)
      if site
        site.open_site? ? [0,1,2] : [0,1]
      else
        []
      end
    end
  </code></pre>
  
  <p>The above doesn't work. None of the options are disabled.</p>
  
  <p>While the correct values display in dropdown in both cases, the select tag is not disabled, and note that in this example, I just set disabled to true, but of course I would be conditionally disabling the select tags.</p>