Forum: Ruby on Rails css selectors and ActionView::FormHelper

Announcement (2017-05-07): is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see and for other Rails- und Ruby-related community platforms.
James B. (Guest)
on 2009-02-26 23:57
Rails 2.2.2

In a view partial, When I do this:

      <%= label client_detail.class.to_s.downcase,
                "Credit Limit: ",
                :class => :input_box_label,
                :for => 'input_client_credit_limit

      <%= ff.text_field  :client_credit_limit,
            :id => 'input_client_credit_limit',
            :size => 12,
            :value => client_detail.client_credit_limit

Then I see this:

      <label class="input_box_label"
         Credit Limit:

         size="12" type="text" value="0" />

But, when I do this:

    <%= label :client,
              "Credit Policy",
              :class => :input_box_label

    <%= :client_credit_policy,
              [ ['CASH - Advance Billing', 'CASH'],
                ['OPEN - Open Account', 'OPEN'],
              :prompt => 'Select Credit Policy Code',
              :size => 4

Then I see this:

      Credit Policy

       <option value="CASH" selected="selected">
          CASH - Advance Billing</option>
       <option value="OPEN">
          OPEN - Open Account</option>

Select does not honour the :id => 'text' option when provided. Instead
it creates an id of the form <model>_<attribute>.  However, text_field
does honour the :id => 'text' option if given.

Is this a bug?
This topic is locked and can not be replied to.