Skip to content

undefined method `before' for Grape::API:Class #58

@klappy

Description

@klappy

I see the documentation for it and this one example, but cannot get it to work.
Surely I am missing the method 'before' defined in the Grape::API class in the source code.
Is it just me or does the before render a method_missing error?

class MyProject::API < Grape::API
  prefix 'api'
  version '1.0'

  rescue_from :all #for all errors

  before do
    # before code
  end
...
end

"undefined method `before' for MyProject::API:Class"

Thanks in advance!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions