{"record":{"id":"5c962f6ac13fc6ee","repo":"ViewComponent/view_component","slug":"slot-cannot-start-with-call-please-rename-sl","errorCode":null,"errorMessage":"Slot cannot start with 'call_'. Please rename #{slot_name}","messagePattern":"Slot cannot start with 'call_'\\. Please rename #(.+?)","errorType":"exception","errorClass":"ViewComponent::InvalidSlotNameError","httpStatus":null,"severity":"error","filePath":"lib/view_component/slotable.rb","lineNumber":343,"sourceCode":"\n        __vc_raise_if_slot_conflicts_with_call(slot_name)\n        __vc_raise_if_slot_ends_with_question_mark(slot_name)\n        __vc_raise_if_slot_registered(slot_name)\n      end\n\n      def __vc_raise_if_slot_registered(slot_name)\n        if registered_slots.key?(slot_name)\n          raise RedefinedSlotError.new(name, slot_name)\n        end\n      end\n\n      def __vc_raise_if_slot_ends_with_question_mark(slot_name)\n        raise SlotPredicateNameError.new(name, slot_name) if slot_name.to_s.end_with?(\"?\")\n      end\n\n      def __vc_raise_if_slot_conflicts_with_call(slot_name)\n        if slot_name.start_with?(\"call_\")\n          raise InvalidSlotNameError, \"Slot cannot start with 'call_'. Please rename #{slot_name}\"\n        end\n      end\n\n      def __vc_raise_if_slot_name_uncountable(slot_name)\n        slot_name = slot_name.to_s\n        if slot_name.pluralize == slot_name.singularize\n          raise UncountableSlotNameError.new(name, slot_name)\n        end\n      end\n    end\n\n    def __vc_get_slot(slot_name)\n      @__vc_set_slots ||= {}\n      content unless defined?(@__vc_content_evaluated) && @__vc_content_evaluated # ensure content is loaded so slots will be defined\n\n      # If the slot is set, return it\n      return @__vc_set_slots[slot_name] if @__vc_set_slots[slot_name]\n","sourceCodeStart":325,"sourceCodeEnd":361,"githubUrl":"https://github.com/ViewComponent/view_component/blob/9f22c36fa7d7b44098a8ed97472e3b4674ae420f/lib/view_component/slotable.rb#L325-L361","documentation":"Raised when a slot name starts with call_ (lib/view_component/slotable.rb:341-345). ViewComponent derives several method names from every slot: the with_<name> setter, the with_<name>_content setter, the reader, the predicate, and internal call helpers for lambda-backed slots such as the method defined as _call_<name> in __vc_define_slot (lib/view_component/slotable.rb:296). The call_ prefix is reserved to keep that generated namespace free of collisions. Unlike the neighboring errors this one is raised as a plain InvalidSlotNameError with an inline message.","triggerScenarios":"renders_one :call_to_action, renders_many :call_logs, or any name whose first five characters are call_, passed to either macro. The check runs inside both validators, so singular and plural forms are equally affected.","commonSituations":"Marketing and hero components with a call_to_action slot, the most natural name that trips this rule; dialer and support tools with attributes such as call_notes or call_status copied from columns or routes into slots.","solutions":["Rename the slot, for example :cta, :action or :callback (callback does not start with call_)","When the slot mirrors a model attribute named call_something, map it to a different slot name explicitly at the call site"],"exampleFix":"# before\nclass HeroComponent < ViewComponent::Base\n  renders_one :call_to_action, ButtonComponent # raises InvalidSlotNameError\nend\n\n# after\nclass HeroComponent < ViewComponent::Base\n  renders_one :cta, ButtonComponent\nend","handlingStrategy":"validation","validationCode":"def slot_name_safe?(name)\n  !name.to_s.start_with?(\"call_\")\nend\n\nslot_name_safe?(:call_to_action) # => false","typeGuard":null,"tryCatchPattern":"begin\n  renders_one(candidate.to_sym)\nrescue ViewComponent::InvalidSlotNameError => e\n  raise unless candidate.to_s.start_with?(\"call_\")\n  candidate = :cta\n  retry\nend","preventionTips":["Treat the call_ prefix as reserved for slots; ordinary words such as callback or calls are fine","Map model attributes and route names starting with call_ onto different slot names during extraction"],"tags":["ruby","rails","view-component","slots","reserved-prefix","naming"],"backgroundTag":"reserved-name-conflict","analyzedSha":"9f22c36fa7d7b44098a8ed97472e3b4674ae420f","analyzedAt":"2026-08-23T10:20:47.008Z","schemaVersion":2},"datasetVersion":"2026-08-23T13:39:53.451Z"}