Skip to content

rigor-actionpack

Checks controller-side Action Pack code across four areas, by consuming facts other Rails plugins publish (ADR-9):

  • Route-helper callsredirect_to user_path(@user) against the :helper_table from rigor-rails-routes.
  • Filter chainsbefore_action :name against the controller’s (and its parents’) defined methods.
  • Render targetsrender :show / render partial: against the view templates under view_search_paths.
  • Strong parametersparams.require(:user).permit(:name, …) keys against the model’s columns (via :model_index from rigor-activerecord).

It ships bundled in rigortype. Activate it under plugins:, alongside the producers whose facts it consumes:

plugins:
- rigor-rails-routes # publishes :helper_table (optional)
- rigor-activerecord # publishes :model_index (optional)
- rigor-actionpack

Both dependencies are declared optional — a project that omits a producer still loads; the area that needed that fact degrades to a no-op rather than erroring.

RuleSeverityFires when
plugin.actionpack.helper-callinfoa *_path / *_url call resolved against the helper table
plugin.actionpack.unknown-helpererrorthe helper name is not in the table (with a did-you-mean)
plugin.actionpack.wrong-helper-arityerrorthe call’s positional-arg count ≠ the helper’s recorded arity
plugin.actionpack.filter-callinfoa filter reference (before_action :name, skip_around_action, …) resolved to a defined method
plugin.actionpack.unknown-filter-methoderrora filter reference names a method not defined on the controller or a parent (with a did-you-mean)
plugin.actionpack.render-targetinfoan explicit render :symbol / "string" / partial: resolved to a view template
plugin.actionpack.missing-templateerroran explicit render resolved to a view path that doesn’t exist under any view_search_paths
plugin.actionpack.permit-callinfoa params.require(:m).permit(:key, …) chain resolved to a known model; keys matched against its columns
plugin.actionpack.unknown-permit-keyerrora literal permit(:key) isn’t a column on the model (with a did-you-mean)

Filter and render resolution honours nested-module controller qualification (module Admin; class WidgetsController resolves views under admin/widgets/…) and silences gem-shipped parent classes it can’t see.

plugins:
- gem: rigor-actionpack
config:
controller_search_paths: ["app/controllers"] # default
view_search_paths: ["app/views"] # default
  • Implicit-self helpers only. *_path / *_url calls with an explicit receiver (Rails.application.routes.url_helpers.x_path) are passed through.
  • Path-based file filter. Files under controller_search_paths are checked regardless of class hierarchy; a non-controller file placed there (rare) would be scanned.
  • Coverage follows the upstream facts. Helper validation only knows what rigor-rails-routes published, and permit validation only what rigor-activerecord published — enabling those producers widens what this plugin can check.

The cross-plugin fact contract (:helper_table / :model_index), the controller/view discovery producers, the demo, and the contract surfaces this plugin exercises are in the plugin’s README. To write a plugin, see examples/ and the rigor-plugin-author skill.

© 2026 TypedDuck. Licensed under CC BY-SA 4.0.