On Mon, Jul 23, 2012 at 12:12 PM, lalalalala pqpqpqpqpq
<[email protected]> wrote:

> <% form_tag(:controller => 'opt', :action => 'index', :id => 1) do %>
>    <%= select_tag "option", options_for_select(@options, "") %>
>    <%= submit_tag "go"%>
> <%end%>

> In my controller, for my index method I have:
>
> class optController < ApplicationController

which is wrong - s/b OptController

> def index
> @options = ["Option A", "Option B", "Option C"]
> end

> As you can see I'm only passing the id: 1 everytime I click go.

No, you're not. Again: look at your page using 'view source' in your
browser. Look *closely* at your form. Then go back and re-read the
doc for options_for_select.

Now select something, submit the form and see what's logged.

-- 
Hassan Schroeder ------------------------ [email protected]
http://about.me/hassanschroeder
twitter: @hassan

-- 
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to