<input type="text" name="txtName" size="20" />
<select name="ddmCardType"> <option value="1">Discover</option> <option value="2">Master Card</option> <option value="3">Visa</option> </select>Check Box: Fulltime Student
<input type="checkbox" name="txtFulltimeStatus" /> Fulltime StudentRadio Button: Discover
<input type="radio" name="cardType" /> Discover <input type="radio" name="cardType" /> Master Card <input type="radio" name="cardType" checked="checked" /> Visa
<form name="frmMain" action="summary.php" method="get"> ... Controls go here. </form>
<%= form_tag 'show' do %> ... Controls go here. <% end %>
<%= text_field_tag :cel, @c, :class => 'ctrl' %>
<%= submit_tag 'Convert Temperature', :class => 'ctrl' %>
<%= select_tag :source_rate, options_for_select([["Dollars", "1.00000"], ["Euro", "1.36749"], ["Pesos", "12.6149"], ["Pounds", "1.58228"]]), :class => 'ctrl' %>:source_rate is the name
<%= radio_button_tag :group, :value, true %>:group sets the button group (in a group of radio buttons, only can be checked at a time)
<%= check_box_tag :sugar, 1, false %>:sugar is the name
<%= form_tag 'show' do %> <%= text_field_tag :cel, @cel %> <%= submit_tag 'Convert Temperature' %> <% end %>
input = params[:cel] @c = input.to_iThe String input is then converted to the integer @c.
get "/convert/show"It specifies the route with controller = convert, action = show, and method = get as a named route.
post "/convert/show"
# Use the new method to create an empty array. # Use the << method to append items to the array. pets = Array.new pets << 'dog' pets << 'cat' pets << 'parrot' pets << 'goldfish' # Use the shortcut method: pets = ['dog', 'cat', 'parrot', 'goldfish'] # Use the new method with a multiplication factor: a = Array.new(3, 'dog')