On Sun, Aug 21, 2011 at 10:00 AM, mr ma <[email protected]> wrote:

> I have a view with a radio-button: I need to pass 2 parameters
> ("opt.id" and "opt.option") to the relative action;
> as for the following code I 've used, I find in params[:option_id]
> only the id of the selected option...
> How can I do to pass also "opt.option"?
>
>      <% for opt in @options %>
>            <p>
>              <%= label_tag(:answer, opt.option) %>
>              <%= radio_button_tag(:option_id, opt.id, false) %>
>            </p>
>      <% end %>

If you're generating these options, shouldn't you know what option
goes with an id?  :-)

-- 
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 this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.

Reply via email to