Re: text_field value doubt

Colin Law
2010-07-09T13:39:49Z

On 9 July 2010 14:10, Zeeshan Nazim
<lists-fsXkhYbjdPsEEoCn2XhGlw@public.gmane.org>
wrote:
> <%= f.text_field :item, :value => Date.today %>
> above code displays todays date in item text field.
>
> I want to display the parameter thr(search string)..somthin lik
> <%= f.text_field :item, :value => params[:search_string] %>
> but above code does not work.
>
> Textfield is blank and no param value is printed. why? plz help.
>
> Btw the search_string(param) was entered thru a textField that was in a
> different view page. do we have to pass it to this
''creteForm'' view
> page. if yes,how to do it?

Have a look at the Getting Started guide at
http://guides.rubyonrails.org/.  It will show you how to setup an @
variable in the controller to display in the view.

Also have a look at the guide on debugging so that you see how to
break into your code and inspect variables to see what is going on
when it does not work.

Colin


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

--
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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
To unsubscribe from this group, send email to
rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
For more options, visit this group at