Why am I getting an ActionView::Template::Error
New here? Learn about Bountify and follow @bountify to get notified of new bounties! x
awarded to Wikimedia

Crowdsource coding tasks.

1 Solution


You're getting that error because in your ability model, the initialize method gets a user parameter, and that user param is nil. I'd recommend reading https://github.com/ryanb/cancan/wiki/Defining-Abilities on how to set up abilities. Hope this helps!

I'm not sure I understand what you mean by that, but I added this commit, and it seemed to fix the problem. However, I feel its incorrect. How is this "fix" related to your suggestion? I only ask because i'm not sure I understand why putting a current_user seemed to make show action work again. https://github.com/akshatpradhan/parcel/commit/40b4c0ec442b1b26091ec2f89edc77bff8c621e4 I've modified the Parcel facebook login so that you can login via facebook through your dev environment. This makes it so that you don't have to create your own facebook app / api keys.
akshatpradhan over 6 years ago
Yeah, you're solution is correct, because before it was looking for a user object that wasn't being passed, like @user, but it really needed current_user since that's who you're checking against. I hope that makes sense, glad you figured it out!
magicmarkker over 6 years ago
So how do I award myself a bounty? ;)
akshatpradhan over 6 years ago
That, sir, I do not know :) haha
magicmarkker over 6 years ago
Haha, ok, well I've deployed Parcel It's now up on http://parcel.herokuapp.com What do you think?
akshatpradhan over 6 years ago
Looks awesome, good job!
magicmarkker over 6 years ago