In our raols application we have a page where upon submit we save data
in db. On this page, we have some fields which are dynamically
generated and I see that in case of a validation error when page
reloads it doesn’t populate these fields with the values present upon
posting.
In controller we have the following method defined for populating it:
def
build_my_registration_type_memberships
@memberships =
[]
ListCache.my_registration_types.each do |
my_registration_type|
@memberships <<
MyRegistrationTypeMembership.find_or_initialize_by_my_id_and_my_registration_type_id(
@my.id,
my_registration_type.id )
end
end
In above method when my registration is opened in edit/view mode, it
shows the values using this @membership method. But on posting in case
of error it doesn’t reload this with correct information. So my
question is how could I repopulate @membership in case of an error on
posting?
Thanks for help.