# Cannot change :id in form.select(..)

**URL:** <https://www.ruby-forum.com/t/cannot-change-id-in-form-select/143751>\
**Category:** Rails\
**Created:** [July 22, 2008, 1:52pm UTC](https://www.ruby-forum.com/t/cannot-change-id-in-form-select/143751 "2008-07-22T13:52:17Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![jeanluca](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/74df32/32.png) [@jeanluca](https://www.ruby-forum.com/u/jeanluca)\
**Post date:** [July 22, 2008, 1:52pm UTC](https://www.ruby-forum.com/t/cannot-change-id-in-form-select/143751/1 "2008-07-22T13:52:17Z")

</div>

Hi All

I have the following code

form\_for :MyPrice, :url =\> …

```
form.file_field :uploaded_data, :size => 17

form.text_field :price, :class => :price_digits
form.text_field :price, :class => :price_frac

```

This works fine, however the 2 price text\_fields have the same ID. So I  
would like to change this into

```
form.text_field :price_digits, :class => :price_digits
form.text_field :price_frac, :class => :price_frac

```

But than I get the follwoing error:

undefined method `price\_digits’ for #MyPrice:0x2156650

Are there restrictions on the id ? What do I have to do to let this work  
?

thnx a lot  
LuCa

---

<div class="post-metadata">

**Author:** ![jeanluca](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/74df32/32.png) [@jeanluca](https://www.ruby-forum.com/u/jeanluca)\
**Post date:** [July 22, 2008, 2:03pm UTC](https://www.ruby-forum.com/t/cannot-change-id-in-form-select/143751/2 "2008-07-22T14:03:59Z")

</div>

I solved it, the id can only represent attributes of the model, which in  
my case is MyPrice. If the attribute doesn’t exist the method doesn’t  
exist too -\> method undefined.

cheers  
LuCa
