lib/generators/dry_crud/templates/app/controllers/list_controller.rb
def with_callbacks(*kinds, &block)
      kinds.reverse.inject(block) do |b, kind|
        lambda { run_callbacks(kind, &b) }
      end.call
    end
# Helper method the run the given block in between the before and after
# callbacks of the given kinds.
Helper method the run the given block in between the before and after
callbacks of the given kinds.
Helper method the run the given block in between the before and after callbacks of the given kinds .
def with_callbacks(*kinds, &block)
      kinds.reverse.inject(block) do |b, kind|
        lambda { run_callbacks(kind, &b) }
      end.call
    end
def with_callbacks ( * kinds , & block ) kinds . reverse . inject ( block ) do | b , kind | lambda { run_callbacks ( kind , & b ) } end . call end
Helper method the run the given block in between the before and after
callbacks of the given kinds.
Helper method the run the given block in between the before and after callbacks of the given kinds .
kinds
block