Skip to content

Scope constraints #2

@Startouf

Description

@Startouf

I'd like to be able to reuse the same path helper, but either I cannot figure the right way to write th routes, or it's impossible.

I'm trying to do something like that

resource :employees do
  patch 'mass_update', on: :collection, as: 'mass_update' do
    scope constraints: CommitParamRouting.new('publish'), action: 'mass-publish'
    scope constraints: CommitParamRouting.new('unpublish'), action: 'mass-unpublish'
    ...
  end
end

The above code compiles, but there is no filtering done. the first line patch doesn't have a constraint and is matched automatically, without the need to evaluate the nested constraints

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions