andrewculver / koudoku

Robust subscription support for Rails with Stripe.
MIT License
1.16k stars 187 forks source link

Unable to autoload constant Koudoku::SubscriptionsController, expected [FilePath] to define it #154

Closed n1shantshrivastava closed 8 years ago

n1shantshrivastava commented 8 years ago

Hi, I am pretty new with this, and I am facing problem when I am trying to override the methods of SubscriptionController. I have placed my new SubscriptionsController class in

app/controllers/koudoku/subscriptions_controller.rb

and the class looks like, below; class SubscriptionsController def edit --- my logic --- end def update --- my logic --- end def cancel --- my logic --- end end

But when I try to load the application, I get this error;

Unable to autoload constant Koudoku::SubscriptionsController, expected /Users/nishant/projects/rails/YoApp/app/controllers/koudoku/subscriptions_controller.rb to define it

Can anyone please help me with this.

yas4891 commented 8 years ago

Your code does not define Koudoku::SubscriptionsController - it defines YoApp::SubscriptionsController.

try

module Koudoku
  class SubscriptionsController < ApplicationController
  end
end
n1shantshrivastava commented 8 years ago

Wao, thanks! @yas4891

But then it gives me this error

super: no superclass method `edit' for #Koudoku::SubscriptionsController:0x007fa5713c0aa0

n1shantshrivastava commented 8 years ago

I got it resolved, by implementing all the methods in call-back (before_filter).

n1shantshrivastava commented 8 years ago

Now to over-ride the freak thing!

Thanks again @yas4891 for quick reply.

yas4891 commented 8 years ago

You're welcome. Have fun with Koudoku