# Correct way to capture a select param

**URL:** <https://www.ruby-forum.com/t/correct-way-to-capture-a-select-param/89435>\
**Category:** Rails\
**Created:** [March 28, 2006, 9:50pm UTC](https://www.ruby-forum.com/t/correct-way-to-capture-a-select-param/89435 "2006-03-28T21:50:12Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![BBBBBB](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/b/43a26b/32.png) [@BBBBBB](https://www.ruby-forum.com/u/BBBBBB)\
**Post date:** [March 28, 2006, 9:50pm UTC](https://www.ruby-forum.com/t/correct-way-to-capture-a-select-param/89435/1 "2006-03-28T21:50:12Z")

</div>

I’m having trouble capturing the params from a select type form.

For text field like this:

\<%= text\_field\_tag :courseid %\>

I’m able to capture the posted value with this

params[:courseid]

However with a select field like this:

\<%= select(:course, :id, %w{value1 value2 value3} %\>

I’m not sure how to capture the posted value.

---

<div class="post-metadata">

**Author:** ![BBBBBB](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/b/43a26b/32.png) [@BBBBBB](https://www.ruby-forum.com/u/BBBBBB)\
**Post date:** [March 28, 2006, 11:07pm UTC](https://www.ruby-forum.com/t/correct-way-to-capture-a-select-param/89435/2 "2006-03-28T23:07:47Z")

</div>

I did a “sudo gem install rails --source [http://gems.rubyonrails.org](http://gems.rubyonrails.org)”  
to get the latest version, before trying a freeze\_edge on my app.  
Running on OSX 10.4.5.

There appears to be problem with lighttpd.conf. What should CWD’s  
value be?

[tachyon][~/Rails/test11]$ script/server webrick  
=\> Booting WEBrick…  
=\> Rails application started on [http://0.0.0.0:3000](http://0.0.0.0:3000)  
=\> Ctrl-C to shutdown server; call with --help for options  
[2006-03-28 15:22:21] INFO WEBrick 1.3.1  
[2006-03-28 15:22:21] INFO ruby 1.8.4 (2005-12-24) [powerpc-  
darwin8.3.0]  
[2006-03-28 15:22:21] INFO WEBrick::HTTPServer#start: pid=7945  
port=3000  
^C[2006-03-28 15:22:27] INFO going to shutdown …  
[2006-03-28 15:22:27] INFO WEBrick::HTTPServer#start done.

[tachyon][~/Rails/test11]$ script/server  
=\> Booting lighttpd (use ‘script/server webrick’ to force WEBrick)  
=\> Rails application started on [http://0.0.0.0:3000](http://0.0.0.0:3000)  
=\> Call with -d to detach  
=\> Ctrl-C to shutdown server (see config/lighttpd.conf for options)  
Undefined config variable: var.CWD  
2006-03-28 15:22:36: (configfile.c.800) source: config/lighttpd.conf  
line: 8 pos: 43 parser failed somehow near here: +  
Exiting

Cheers,  
Paul

---

<div class="post-metadata">

**Author:** ![BBBBBB](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/b/43a26b/32.png) [@BBBBBB](https://www.ruby-forum.com/u/BBBBBB)\
**Post date:** [March 28, 2006, 11:37pm UTC](https://www.ruby-forum.com/t/correct-way-to-capture-a-select-param/89435/3 "2006-03-28T23:37:35Z")

</div>

What version of Light? needs to be 1.4.10 or above I believe.

~ Ben

On 3/28/06, Paul M. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> =\> Ctrl-C to shutdown server; call with --help for options  
> =\> Rails application started on [http://0.0.0.0:3000](http://0.0.0.0:3000)  
> Rails mailing list  
> removed\_email\_address@domain.invalid  
> [http://lists.rubyonrails.org/mailman/listinfo/rails](http://lists.rubyonrails.org/mailman/listinfo/rails)

–  
Ben R.  
[http://www.benr75.com](http://www.benr75.com)

---

<div class="post-metadata">

**Author:** ![BBBBBB](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/b/43a26b/32.png) [@BBBBBB](https://www.ruby-forum.com/u/BBBBBB)\
**Post date:** [March 28, 2006, 11:59pm UTC](https://www.ruby-forum.com/t/correct-way-to-capture-a-select-param/89435/4 "2006-03-28T23:59:46Z")

</div>

Paul M. wrote:

> I did a “sudo gem install rails --source [http://gems.rubyonrails.org](http://gems.rubyonrails.org)” to  
> get the latest version, before trying a freeze\_edge on my app. Running  
> on OSX 10.4.5.
> 
> There appears to be problem with lighttpd.conf. What should CWD’s value be?

Per [http://clarkware.com/cgi/blosxom/2006/03/28#Rails11](http://clarkware.com/cgi/blosxom/2006/03/28#Rails11)

You need to be running lighttpd 1.4.11.

Ray

---

<div class="post-metadata">

**Author:** ![BBBBBB](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/b/43a26b/32.png) [@BBBBBB](https://www.ruby-forum.com/u/BBBBBB)\
**Post date:** [March 29, 2006, 12:00am UTC](https://www.ruby-forum.com/t/correct-way-to-capture-a-select-param/89435/5 "2006-03-29T00:00:35Z")

</div>

Did a “rake freeze\_edge” on my app followed by “rake rails:update”,  
then get this error.  
Installed in my app are "Engines, “LoginEngine”, “UserEngine” and  
“Userstamp”.

=\> Booting WEBrick…  
./script/…/config/…/vendor/rails/activesupport/lib/active\_support/  
inflector.rb:125:in `underscore': stack level too deep (SystemStackError) from ./script/../config/../vendor/rails/activesupport/lib/ active_support/core_ext/string/inflections.rb:29:in`underscore’  
from ./script/…/config/…/vendor/rails/activesupport/lib/  
active\_support/dependencies.rb:84:in `const_missing' from ./script/../config/../vendor/plugins/engines/lib/ dependencies_extensions.rb:28:in`require\_or\_load’  
from ./script/…/config/…/vendor/rails/activesupport/lib/  
active\_support/dependencies.rb:30:in `depend_on' from ./script/../config/../vendor/rails/activesupport/lib/ active_support/dependencies.rb:74:in`require\_dependency’  
from ./script/…/config/…/vendor/rails/activesupport/lib/  
active\_support/dependencies.rb:87:in `const_missing' from ./script/../config/../vendor/plugins/engines/lib/ dependencies_extensions.rb:28:in`require\_or\_load’  
from ./script/…/config/…/vendor/rails/activesupport/lib/  
active\_support/dependencies.rb:30:in `depend_on' ... 1322 levels... from ./script/../config/../vendor/rails/railties/lib/ commands/servers/webrick.rb:52 from ./script/../config/../vendor/rails/activesupport/lib/ active_support/dependencies.rb:136:in`require’  
from ./script/…/config/…/vendor/rails/railties/lib/  
commands/server.rb:30  
from script/server:3

Cheers,  
Paul

---

<div class="post-metadata">

**Author:** ![BBBBBB](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/b/43a26b/32.png) [@BBBBBB](https://www.ruby-forum.com/u/BBBBBB)\
**Post date:** [March 29, 2006, 12:18am UTC](https://www.ruby-forum.com/t/correct-way-to-capture-a-select-param/89435/6 "2006-03-29T00:18:09Z")

</div>

I ran into this problem when I was doing some testing on Rails Edge.  
You will need to updates Rails Engines, I believe they just released a  
version today that supports rails 1.1

* * *

What’s an Intel chip doing in a Mac? A whole lor more that it’s ever  
done in a PC.

My Digital Life - [http://scottwalter.com/blog](http://scottwalter.com/blog)  
Pro:Blog - [http://scottwalter.com/problog](http://scottwalter.com/problog)

----- Original Message ----  
From: Paul M. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)  
To: removed\_email\_address@domain.invalid  
Sent: Tuesday, March 28, 2006 3:47:42 PM  
Subject: [Rails] Rails 1.1 on OSX 10.4.5 startup error

Did a “rake freeze\_edge” on my app followed by “rake rails:update”,  
then get this error.  
Installed in my app are "Engines, “LoginEngine”, “UserEngine” and  
“Userstamp”.

=\> Booting WEBrick…  
./script/…/config/…/vendor/rails/activesupport/lib/active\_support/  
inflector.rb:125:in `underscore': stack level too deep (SystemStackError) from ./script/../config/../vendor/rails/activesupport/lib/ active_support/core_ext/string/inflections.rb:29:in `underscore’  
from ./script/…/config/…/vendor/rails/activesupport/lib/  
active\_support/dependencies.rb:84:in `const_missing' from ./script/../config/../vendor/plugins/engines/lib/ dependencies_extensions.rb:28:in `require\_or\_load’  
from ./script/…/config/…/vendor/rails/activesupport/lib/  
active\_support/dependencies.rb:30:in `depend_on' from ./script/../config/../vendor/rails/activesupport/lib/ active_support/dependencies.rb:74:in `require\_dependency’  
from ./script/…/config/…/vendor/rails/activesupport/lib/  
active\_support/dependencies.rb:87:in `const_missing' from ./script/../config/../vendor/plugins/engines/lib/ dependencies_extensions.rb:28:in `require\_or\_load’  
from ./script/…/config/…/vendor/rails/activesupport/lib/  
active\_support/dependencies.rb:30:in `depend_on' ... 1322 levels... from ./script/../config/../vendor/rails/railties/lib/ commands/servers/webrick.rb:52 from ./script/../config/../vendor/rails/activesupport/lib/ active_support/dependencies.rb:136:in `require’  
from ./script/…/config/…/vendor/rails/railties/lib/  
commands/server.rb:30  
from script/server:3

Cheers,  
Paul

---

<div class="post-metadata">

**Author:** ![BBBBBB](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/b/43a26b/32.png) [@BBBBBB](https://www.ruby-forum.com/u/BBBBBB)\
**Post date:** [March 29, 2006, 12:02am UTC](https://www.ruby-forum.com/t/correct-way-to-capture-a-select-param/89435/7 "2006-03-29T00:02:58Z")

</div>

I believe that params[:course][:id] will get you there.

HTH,  
Bill  
----- Original Message -----  
From: “BB” [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)  
To: [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)  
Sent: 2006-03-28 1:50 PM  
Subject: [Rails] Correct way to capture a select param

---

<div class="post-metadata">

**Author:** ![BBBBBB](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/b/43a26b/32.png) [@BBBBBB](https://www.ruby-forum.com/u/BBBBBB)\
**Post date:** [March 29, 2006, 12:20am UTC](https://www.ruby-forum.com/t/correct-way-to-capture-a-select-param/89435/8 "2006-03-29T00:20:47Z")

</div>

Installed 1.4.11. That fixed things. Thanks.  
Paul

---

<div class="post-metadata">

**Author:** ![BBBBBB](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/b/43a26b/32.png) [@BBBBBB](https://www.ruby-forum.com/u/BBBBBB)\
**Post date:** [March 29, 2006, 12:30am UTC](https://www.ruby-forum.com/t/correct-way-to-capture-a-select-param/89435/9 "2006-03-29T00:30:44Z")

</div>

Thank you bill, worked like I always hoped it would

Bill W. wrote:

> I believe that params[:course][:id] will get you there.
> 
> HTH,  
> Bill  
> ----- Original Message -----  
> From: “BB” [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)  
> To: [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)  
> Sent: 2006-03-28 1:50 PM  
> Subject: [Rails] Correct way to capture a select param
