Frederick Cheung wrote in post #957392:
> On Oct 26, 10:48pm, debalmoto <debalm...@gmail.com> wrote:
>> <p>
>>     <%= text_field_tag(:number_one, value = 0) %>
>>     <%= text_field_tag(:number_two, value = 0) %>
>> </p>
>> <p>
>>     <%= @sum %>
>> </p>
>>
>> That's all of it.
>
> Time for HTML lesson 1: if you want inputs to get sent to the server,
> they need to be enclosed in a form (modulo javascript trickery).
>
> Fred

Exactly.

So you may want to change the view code to look like this:

  <%= form_tag('/') do -%>
<p>
  <%= text_field_tag(:number_one, value = 0)  %>
  <%= text_field_tag(:number_two, value = 0)  %>
  <%= submit_tag 'Calculate' %>
</p>
  <% end %>
<p>
  <%= @sum %>
</p>

-- 
Posted via http://www.ruby-forum.com/.

-- 
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 rubyonrails-t...@googlegroups.com.
To unsubscribe from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.

Reply via email to