Skip to content

allow if/unless for action/format filters #68

@ryancyq

Description

@ryancyq

e.g. when a controller has 10 action methods, and the before/after/around callback configuration will need to specify 9 actions to exclude the 1 action.

# before
act_before :fetch_events, action: :index 
act_before :fetch_event, action: [:show, :edit, :update, :destroy, :print, :postpone, :add_tags, :add_categories]

# after
act_before :fetch_events, action: { if: :index } # or action: :index
act_before :fetch_event, action: { unless: :index }

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions