Andy Cohen

Joined

10 Experience
0 Lessons Completed
0 Questions Solved

Activity

Posted in Routing Concerns and Scopes in Rails Discussion

The concern definition block actually takes a hash of options, so another approach could look like:

  concern :likeable do |options = {}|
    resource :like, only: :update, defaults: **options
  end

  resources :comments do
    concerns :likeable, resource: :comments
  end