On Friday, June 27, 2014 8:32:03 PM UTC-4, sri wrote: > > i'd like a method that returns a list of the fields that failed validation >> in Mojolicious::Validator::Validation. this allows for easier validation >> error handling when not using the form tag helpers >> > > Do you have any real world use cases you could show us? >
yes - REST api PUT or POST method that returns validation error info in JSON or xml response - ajax update method that returns JSON only (no html on the wire) also, the use of tag helpers isn't always convenient in html templates. sometimes it's easier to keep the template content as close to raw html as possible. for example: - when migrating templates from another platform - when adapting templates from a commercial template gallery - when templates are developed/maintained by a separate "front end" team (e.g. by customer's marketing agency) if you don't use tag helpers, you need to do something with server-side validation results. we commonly do the primary html form validation client-side (via jquery.validate or similar), with the server-side validation providing a backstop primarily for security purposes. in this approach, server-side validation errors should be very rare, and probably indicate a problem in the client-side code or someone trying to bypass the validation rules, so the error presentation doesn't need to be very fancy (i.e. the field-level error highlighting provided by the tag helpers isn't required). jay -- You received this message because you are subscribed to the Google Groups "Mojolicious" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. Visit this group at http://groups.google.com/group/mojolicious. For more options, visit https://groups.google.com/d/optout.
