The Depot Application

The Depot Application

23.8 Uploading Files to Rails Applications 23.6 Custom Form Builders

23.7 Working with Nonmodel Fields

edit app/views/test/calculate.html.erb
<% unless @errors.blank? %>
  <ul>
  <% for error in @errors %>
    <li><p><%= h(error) %></p></li>
  <% end %>
  </ul>
<% end %>
 
<%= form_tag(:action => :calculate) do %>
  <%= text_field_tag(:arg1, params[:arg1], :size => 3) %>
  <%= select_tag(:operator, 
                 options_for_select(%w{ + - * / }, 
                                    params[:operator])) %>
  <%= text_field_tag(:arg2, params[:arg2], :size => 3) %>
<% end %>
<strong><%= @result %></strong>
get /test/calculate

23.8 Uploading Files to Rails Applications 23.6 Custom Form Builders