Correct way to capture a select param


#1

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.


#2

I did a “sudo gem install rails --source 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
=> 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
=> 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


#3

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 wrote:

=> Ctrl-C to shutdown server; call with --help for options
=> Rails application started on http://0.0.0.0:3000
Rails mailing list
removed_email_address@domain.invalid
http://lists.rubyonrails.org/mailman/listinfo/rails


Ben R.
http://www.benr75.com


#4

Paul M. wrote:

I did a “sudo gem install rails --source 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

You need to be running lighttpd 1.4.11.

Ray


#5

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:inunderscore’
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:inrequire_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:inrequire_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:inrequire_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:inrequire’
from ./script/…/config/…/vendor/rails/railties/lib/
commands/server.rb:30
from script/server:3

Cheers,
Paul


#6

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
Pro:Blog - http://scottwalter.com/problog

----- Original Message ----
From: Paul M. 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:inunderscore’
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:inrequire_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:inrequire_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:inrequire_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:inrequire’
from ./script/…/config/…/vendor/rails/railties/lib/
commands/server.rb:30
from script/server:3

Cheers,
Paul


#7

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

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


#8

Installed 1.4.11. That fixed things. Thanks.
Paul


#9

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
To: removed_email_address@domain.invalid
Sent: 2006-03-28 1:50 PM
Subject: [Rails] Correct way to capture a select param