Forum: Ruby on Rails Correct way to capture a select param

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
BB (Guest)
on 2006-03-28 23:50
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.
Paul M. (Guest)
on 2006-03-29 01:07
(Received via mailing list)
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
Ben R. (Guest)
on 2006-03-29 01:37
(Received via mailing list)
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
Ray B. (Guest)
on 2006-03-29 01:59
(Received via mailing list)
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
Paul M. (Guest)
on 2006-03-29 02:00
(Received via mailing list)
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
Bill W. (Guest)
on 2006-03-29 02:02
(Received via mailing list)
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
Scott W. (Guest)
on 2006-03-29 02:18
(Received via mailing list)
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: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
Paul M. (Guest)
on 2006-03-29 02:20
(Received via mailing list)
Installed 1.4.11. That fixed things. Thanks.
Paul
BB (Guest)
on 2006-03-29 02:30
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
This topic is locked and can not be replied to.