To Examples

TemperatureConverter2 Example

Source code file: TemperatureConverter2/app/views/convert/display.html.erb:

<h1>Display Converted Temperature</h1>

<p>Name: <%= @n %></p>
<p>Celsius Temperature: <%= @c %></p>
<p>Fahrenheit Temperature: <%= @f %></p>
<p>Previous Conversions</p>

<table>
  <tr>
    <th>Name</th> <th>Celsius</th> <th>Fahrenheit</th>
  </tr>

  <% @recs.each do |r| %>
    <tr>
      <td><%= r.name %></td>
      <td><%= r.cel %></td>
      <td><%= r.fahr %></td>
    </tr>
  <% end %>
</table>

<p><%= link_to 'Input another Temperature', convert_input_path %></p>