Hi all
I am gettng an error message:
can''t convert nil into string
here is my controller:> class GreetController < ApplicationController
> def say_hi
> @message= "Hello " + params[:textName]
> end
> end
>
>
> and my viewer
> <html>
> <head>
> <title> Hello!!!</title>
> </head>
> <body>
> <%= start_form_tag :controller=>''greet'',
:action=>''say_hi'' %>
> <p>Enter Your Name:
> <%= text_field_tag :textName, :size=> 20 %>
> </p><p>
> <label><%= @message %></label>
> </p>
> <p>
> <%= submit_tag( "Hello") %>
> </p>
> <%= end_form_tag %>
> </body>
> </html>
It works when I delete the "+ params[:textName]" in the controller. It
looks like it does not recognize the textbox.
How can I fix that?
thanks
--
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-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
To unsubscribe from this group, send email to
rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk
-~----------~----~----~----~------~----~------~--~---