andrewculver / koudoku

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

NoMethodError at /subscriptions/new undefined method `router_name' for nil:NilClass #183

Closed Ray-Sutton closed 7 years ago

Ray-Sutton commented 7 years ago

After creating a plan, when you click on it, I get an error on the subscriptions/new?plan=2 view. Screenshot below.

Looks like there may be an issue with the app trying to redirect to login possibly?

screen shot 2017-08-25 at 12 07 20 am
Ray-Sutton commented 7 years ago

It looks like this issue happens when a user tries to add a new plan, but doesn't have one on file. On the demo site, it redirects to the card page and references the user. It's almost as if the user can't be found, so there an issue with devise/app. Any suggestions?

screen shot 2017-08-26 at 4 47 49 pm
Ray-Sutton commented 7 years ago

I updated the link to: http://localhost:3000/koudoku/organizations/1/subscriptions/new?plan=2

Replacing users/:id with organizations/:id and i got the route to redirect to unuauthorized. Looks like this is the crux of the issue.

screen shot 2017-08-26 at 5 42 32 pm