Here's what I do,
before_action :validate_presence
and then following methods:
def check_presence
params[:param1].present? && params[:param2].present?
end
def validate_presence
if !check_presence
render json: {
error: {
message: "Bad Request, parameters missing.",
status: 500
}
}
end
end