Forum: Ruby on Rails ActionView::Helpers::FormHelper.text_field

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
757e0ccb6005344ecbc8c096744183b7?d=identicon&s=25 Colin JN Breame (Guest)
on 2005-12-19 11:49
(Received via mailing list)
Hi,

Is it possible to use the ActionView::Helpers::FormHelper.text_field
with an
instance variable instead of a model. e.g.

In the controller:

def meth
	@value = 'hi there'
end

In view:

<%= text_field 'value', nil %>


It doesn't work with what is above (doesn't like the nil) and produces
very
strange results replacing nil with something like to_s.

An alternative might be to use the
ActionView::Helpers::FormTagHelper.text_field_tag but then (I assume)
that
you don't get the error functionality. e.g. highlighting of the field.

Any ideas?

 -- Colin
This topic is locked and can not be replied to.