[Rails] Re: Create super-simple adding application

2010-10-27 Thread debalmoto
Thank you guys so much for your help. I think I have everything working now. It must be frustrating dealing with such simple issues. Just one more question: Did you intend to put the - in %= form_tag('/') do -% ? I removed it and it didn't seem to change anything. Thanks again for the help.

[Rails] Re: Create super-simple adding application

2010-10-26 Thread Frederick Cheung
On Oct 26, 3:18 am, debalmoto debalm...@gmail.com wrote: Ok, so I figured out what was causing the error, I wasnt calling params[:number_one] in the right place. Fixing this took care of the error. Now I can call them in my controller like so: @a = params[:number_one].to_i @b =

[Rails] Re: Create super-simple adding application

2010-10-26 Thread debalmoto
It doesn't say any numbers, the relevant log info just says it processed the GET and got the layout. On Oct 26, 4:32 am, Frederick Cheung frederick.che...@gmail.com wrote: On Oct 26, 3:18 am, debalmoto debalm...@gmail.com wrote: Ok, so I figured out what was causing the error, I wasnt calling

[Rails] Re: Create super-simple adding application

2010-10-26 Thread Frederick Cheung
On 26 Oct, 20:56, debalmoto debalm...@gmail.com wrote: It doesn't say any numbers, the relevant log info just says it processed the GET and got the layout. Sounds like the parameters aren't getting sent What does the rest of the view with the form look like? Fred On Oct 26, 4:32 am,

[Rails] Re: Create super-simple adding application

2010-10-26 Thread debalmoto
p %= text_field_tag(:number_one, value = 0) % %= text_field_tag(:number_two, value = 0) % /p p %= @sum % /p That's all of it. My controller: class UserController ApplicationController def home a = params[:number_one].to_i b = params[:number_one].to_i

[Rails] Re: Create super-simple adding application

2010-10-26 Thread Frederick Cheung
On Oct 26, 10:48 pm, 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

[Rails] Re: Create super-simple adding application

2010-10-26 Thread Eric R.
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

[Rails] Re: Create super-simple adding application

2010-10-25 Thread Frederick Cheung
On Oct 25, 1:14 am, debalmoto debalm...@gmail.com wrote: So far I have this in the view: %= text_field_tag :number_one % %= text_field_tag :number_two % I have tried to call params[:number_one], and params[:number_two] in my controller, but I get an error. What error? Fred -- You

[Rails] Re: Create super-simple adding application

2010-10-25 Thread debalmoto
Anytime I put params[:number_one] or two in my controller and start the server up I get this error on my page: undefined local variable or method `params' for UserController:Class On Oct 25, 5:03 am, Frederick Cheung frederick.che...@gmail.com wrote: On Oct 25, 1:14 am, debalmoto

[Rails] Re: Create super-simple adding application

2010-10-25 Thread debalmoto
Anytime I put params[:number_one] or two in my controller I get this error on my page: undefined local variable or method `params' for ApplicationController:Class On Oct 25, 5:03 am, Frederick Cheung frederick.che...@gmail.com wrote: On Oct 25, 1:14 am, debalmoto debalm...@gmail.com wrote:

[Rails] Re: Create super-simple adding application

2010-10-25 Thread debalmoto
Ok, so I figured out what was causing the error, I wasnt calling params[:number_one] in the right place. Fixing this took care of the error. Now I can call them in my controller like so: @a = params[:number_one].to_i @b = params[:number_one].to_i @sum = @a + @b But when I put numbers in my text