You should check partial existing somewhere before view, for example in controller
ALLOWED_STATES = [].freeze
before_action :check_partial_for_rendering
def check_partial_for_rendering
return if state.in?(ALLOWED_STATES)
# here you can return error, or raise error, or anything
end