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
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
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
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.
-Curtis
thx!
This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.
Sponsor our Newsletter | Privacy Policy | Terms of Service | Remote Ruby Jobs