To raise a 404
in a controller:
raise ActionController::RoutingError, 'Not Found'
If a record is accessed and not found, use ActiveRecord::RecordNotFound
.
Feb 14, 2025
To raise a 404
in a controller:
raise ActionController::RoutingError, 'Not Found'
If a record is accessed and not found, use ActiveRecord::RecordNotFound
.