Hi, is there a way to keep the already entered form fields when the form is re-displayed after some error has been detected and reported to the user via flash? Regards IJD -- Posted via http://www.ruby-forum.com/.
IJD, Try using <%= text_field "object_name","field_name" %> rather than typing the html for the form input fields. If the object is in the request, than it will be filled in properly if that field has a value. In your controller just make you sure you have a instance variable called @object_name. Make a scaffold to see more examples of this. -Curtis IJD IJD wrote:> Hi, > > is there a way to keep the already entered form fields when the form is > re-displayed after some error has been detected and reported to the user > via flash? > > Regards > IJD >
Curtis Spencer wrote:> IJD, > > Try using <%= text_field "object_name","field_name" %> rather than > typing the html for the form input fields. If the object is in the > request, than it will be filled in properly if that field has a value. > In your controller just make you sure you have a instance variable > called @object_name. > > Make a scaffold to see more examples of this. > > -Curtisthx! -- Posted via http://www.ruby-forum.com/.