Reputation: 755
Is anyone familiar with Braintree?? According their documents for rails I have to do this: https://developers.braintreepayments.com/reference/request/plan/all/ruby in order to retrieve plans from api.
Then why is it returning this error: NameError in PlansController#index...uninitialized constant PlansController::BraintreeRails
class PlansController < ApplicationController
def index
@plans = BraintreeRails::Plan.all
end
def show
@plans = BraintreeRails::Plan.find(params[:id])
end
end
Upvotes: 0
Views: 149
Reputation: 693
Replace BraintreeRails
with just Braintree
, as it says in the documentation you linked to.
The error is basically telling you that Ruby does not know of a constant called BraintreeRails
within the context of your PlansController
, as you have mistyped the name.
Upvotes: 1