How to raise 422 error in Rails

I was updating error pages to follow latest GDS standard (https://design-system.service.gov.uk/patterns/). I needed to test the 422 page.

After few failed attempts I found this solution to work, just put this code in your index method on your home page:

    raise(ActionController::InvalidAuthenticityToken)

I hope it helped.

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.