ministryofjustice / govuk_elements_form_builder

Form builder helper methods to develop GOV.UK elements styled applications in Ruby on Rails
https://govuk-elements-rails-guide.herokuapp.com/
MIT License
6 stars 14 forks source link

Enable use with unpersisted objects #77

Closed jsugarman closed 7 years ago

jsugarman commented 7 years ago

Handle NoMethodError when calling .errors method. Using the form builder with an unpersisted object (e.g. a problem report submitter) raises this error since the object does not respond to .errors

jsugarman commented 7 years ago

@ministryofjustice/ruby anyone to review PR please? @aliuk2012 @stephenrichards this is the fix we spoke about for peoplefinder

aliuk2012 commented 7 years ago

Looks fine, could another Ruby dev review as well within the next couple of days.