Skip to content

Example produces NoMethodError #295

@aaronmallen

Description

@aaronmallen

The example on here

# app/actions/users/create.rb

module Bookshelf
  module Actions
    module Users
      class Create < Bookshelf::Action
        accept :json

        def handle(request, response)
          request.params.to_h # => {}
        end
      end
    end
  end
end

will produce a NoMethodError:

NoMethodError at /users
======================

undefined method 'accept' for class Bookshelf::Actions::Users::Create

I'd offer a PR but I'm unsure what the correct method is. I think deleting the line accept :json should be sufficient as the follow up code says to enable the body parser. If so I'm happy to offer a PR doing so

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