{"record":{"id":"a42e90a6634011c8","repo":"thoughtbot/shoulda-matchers","slug":"you-must-specify-the-controller-action-using-the","errorCode":null,"errorMessage":"You must specify the controller action using the #for method.","messagePattern":"You must specify the controller action using the #for method\\.","errorType":"exception","errorClass":"ActionNotDefinedError","httpStatus":null,"severity":"error","filePath":"lib/shoulda/matchers/action_controller/permit_matcher.rb","lineNumber":321,"sourceCode":"        def actual_permitted_parameter_names\n          @_actual_permitted_parameter_names ||= begin\n            options =\n              if subparameter_name\n                { for: subparameter_name }\n              else\n                {}\n              end\n            parameters_double_registry.permitted_parameter_names(options)\n          end\n        end\n\n        def unpermitted_parameter_names\n          expected_permitted_parameter_names - actual_permitted_parameter_names\n        end\n\n        def ensure_action_and_verb_present!\n          if action.blank?\n            raise ActionNotDefinedError\n          end\n\n          if verb.blank?\n            raise VerbNotDefinedError\n          end\n        end\n\n        def default_verb\n          case action\n          when :create then :post\n          when :update then RailsShim.verb_for_update\n          end\n        end\n\n        def parameter_names_as_sentence\n          expected_permitted_parameter_names.map(&:inspect).to_sentence\n        end\n","sourceCodeStart":303,"sourceCodeEnd":339,"githubUrl":"https://github.com/thoughtbot/shoulda-matchers/blob/79cdfbc326e97c9b43991b644434ca53c1f62c4c/lib/shoulda/matchers/action_controller/permit_matcher.rb#L303-L339","documentation":"Error \"You must specify the controller action using the #for method.\" thrown in thoughtbot/shoulda-matchers.","triggerScenarios":"Thrown at lib/shoulda/matchers/action_controller/permit_matcher.rb:321 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"79cdfbc326e97c9b43991b644434ca53c1f62c4c","analyzedAt":"2026-08-23T09:43:24.200Z","schemaVersion":2},"datasetVersion":"2026-08-23T13:39:53.451Z"}