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

Announcement (2017-05-07): is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see and for other Rails- und Ruby-related community platforms.
Colin JN Breame (Guest)
on 2005-12-19 12:49
(Received via mailing list)

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'

In view:

<%= text_field 'value', nil %>

It doesn't work with what is above (doesn't like the nil) and produces
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)
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.