# selection lists

**URL:** <https://discuss.rubyonrails.org/t/selection-lists/27617>\
**Category:** rubyonrails-talk\
**Created:** [April 6, 2008, 2:11pm UTC](https://discuss.rubyonrails.org/t/selection-lists/27617 "2008-04-06T14:11:51Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![erez](https://avatars.discourse-cdn.com/v4/letter/e/e47c2d/32.png) [@erez](https://discuss.rubyonrails.org/u/erez)\
**Post date:** [April 6, 2008, 2:11pm UTC](https://discuss.rubyonrails.org/t/selection-lists/27617/1 "2008-04-06T14:11:51Z")

</div>

Hi Im trying to figure out how to make selection list work My example for this is a Real estate web site download the code here: [URL="[http://www.qcm.co.il/real-](http://www.qcm.co.il/real-) estate.rar"][http://www.qcm.co.il/real-estate.rar\[/URL\]](http://www.qcm.co.il/real-estate.rar%5C%5B/URL%5C%5D)

I have a table named "assets" and a table named "settlements" and a relationship between them [CODE]execute "alter table assets add constraint fk\_asset\_settelments foreign key (settelment\_id) references settelments(id)"[/CODE]

in \_form.rhtml the code is: [CODE]\<p\>\<label for="asset\_settelment\_id"\>Settelment\</label\>\<br /\> \<%= collection\_select(:asset, :settelment\_id, Settelment.find(:all, :order =\> "settelment"), :id, :settelment, options ={:prompt =\> "select"}, :class =\>"settelment") %\> \</p\>[/CODE]

when I try to update an asset settelment I get this error:

[QUOTE]NoMethodError in AssetController#update

undefined method `settelment\_id=' for #\<Asset:0x478694c\> RAILS\_ROOT: ./script/../config/..

Application Trace | Framework Trace | Full Trace C:/InstantRails/ruby/lib/ruby/gems/1.8/gems/activerecord-1.15.3/lib/ active\_record/base.rb:1857:in `method_missing' C:/InstantRails/ruby/lib/ruby/gems/1.8/gems/activerecord-1.15.3/lib/ active_record/base.rb:1672:in `send' C:/InstantRails/ruby/lib/ruby/gems/1.8/gems/activerecord-1.15.3/lib/ active\_record/base.rb:1672:in `attributes=' C:/InstantRails/ruby/lib/ruby/gems/1.8/gems/activerecord-1.15.3/lib/ active_record/base.rb:1671:in `each' C:/InstantRails/ruby/lib/ruby/gems/1.8/gems/activerecord-1.15.3/lib/ active\_record/base.rb:1671:in `attributes=' C:/InstantRails/ruby/lib/ruby/gems/1.8/gems/activerecord-1.15.3/lib/ active_record/base.rb:1591:in `update\_attributes' #{RAILS\_ROOT}/app/controllers/asset\_controller.rb:39:in `update' Request

Parameters: {"commit"=\>"Edit", "id"=\>"1", "asset"=\>{"plot\_area"=\>"3500", "image\_url"=\>"", "updated\_at(1i)"=\>"2008", "updated\_at(2i)"=\>"4", "created\_at(1i)"=\>"2008", "created\_at(2i)"=\>"4", "updated\_at(3i)"=\>"6", "created\_at(3i)"=\>"6", "updated\_at(4i)"=\>"09", "settelment\_id"=\>"1", "updated\_at(5i)"=\>"33", "created\_at(4i)"=\>"09", "created\_at(5i)"=\>"32", "price\_dolar"=\>"1100000", "price\_shekel"=\>"0", "description"=\>"Great house", "built\_area"=\>"230"}}

Show session dump

Response

Headers: {"cookie"=\>, "Cache-Control"=\>"no-cache"}[/QUOTE]

Thank you in advance for your help Please bear with me Im new to programing and my english is not perfect

---

<div class="post-metadata">

**Author:** ![11175](https://avatars.discourse-cdn.com/v4/letter/1/8edcca/32.png) [@11175](https://discuss.rubyonrails.org/u/11175)\
**Post date:** [April 6, 2008, 4:35pm UTC](https://discuss.rubyonrails.org/t/selection-lists/27617/2 "2008-04-06T16:35:24Z")

</div>

you mix the spelling "settlements" and "settelments"

---

<div class="post-metadata">

**Author:** ![erez.bens](https://avatars.discourse-cdn.com/v4/letter/e/ce7236/32.png) [@erez.bens](https://discuss.rubyonrails.org/u/erez.bens)\
**Post date:** [April 6, 2008, 7:38pm UTC](https://discuss.rubyonrails.org/t/selection-lists/27617/3 "2008-04-06T19:38:37Z")

</div>

Thanks Thorsten
