Forum: Ruby on Rails Strange param mixup

Announcement (2017-05-07): is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see and for other Rails- und Ruby-related community platforms.
Milo T. (Guest)
on 2007-06-27 13:30
I have some code looking like this:

<input id="search_param[<%= var %>]" name="search_param[<%= var %>]"
type="checkbox" value="0"/>
<b><font size="-1"><%= var %></font></b><br>
<select name="param_sym[<%= var %>]" type="select">
<option value="1" selected>equals</option>
<option value="2">less than</option>
<option value="3">greater than</option>
<option value="4">less or equals</option>
<option value="5">greater or equals</option>
<option value="6">not equal to</option>
<option value="7">is DEFAULT</option>
<input id="param_value[<%= var %>]" name="param_value[<%= var %>]"
type="text" size="<%= @vlen %>" value=""/>

What I'd expect this to produce for each "var" is:
1. A checkbox with the value params[:search_param]["var"] equal to 0 if
unchecked, 1 if checked.
2. A drop down menu that puts a value of 1-7 (default 1) in
3. A text box that takes user input and places in

What it actually does is:
1. params[:search_param] is not created.
2. params[:param_sym]["var"] is always set to "1"
3. The param value part actually works.

Would anyone mind explaining what I have done wrong?
This topic is locked and can not be replied to.