Rails provide a clean way to rescue exceptions in a controller with a defined method.
Let's suppose that you have a class with method create
that could raise ActiveRecord::RecordInvalid
exception:
class ExampleController < ApplicationController
def create