Welcome to the Treehouse Community
Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.
Start your free trialDavid B Dinkins
71,472 PointsAdd a namespace in Rails API
Challenge Task:
Change the below routes file to include a gone_bananas namespace. Hint: Make sure you have both resources for the API and resources for your application!
I think I'm doing this according to the video by namespacing a :gone_bananas
route, adding resources :monkeys
, and keeping resources :monkeys
outside of the namespace route. However, I'm getting "Bummer! Try Again!". Anybody know what I'm doing wrong here?
Rails.application.routes.draw do
namespace :gone_bananas do
resources :monkeys
end
resources :monkeys
end
Kyle Robertson
31,600 PointsThanks Jay, I'm still getting an error saying it's incorrect when listing resources :monkeys in both the namespace and the application.
And it still says correct but an internal server error when listing it in just the namespace.
Kenan Memis
47,314 PointsNop.. the above code still not working :(
Jay McGavren
Treehouse TeacherThe challenge is checking to ensure that the :monkeys
resource route appears within the :gone_bananas
namespace, and only within the :gone_bananas
namespace... The above code should be failing with the error: "You need to wrap the 'monkeys' route in a 'gone_bananas' namespace."
This answer should pass:
Rails.application.routes.draw do
namespace :gone_bananas do
resources :monkeys
end
end
Kyle Robertson
31,600 PointsIt passes, but then the "Oh no, something's gone wrong.... Contact support" window pops up.
Jay McGavren
Treehouse TeacherKyle Robertson Does it do so even after reloading the page?
Also, there does definitely seem to be a conflict between the question and the expected answer. I'm going to seek clarification from the teacher and get either the hint or the test updated.
Kyle Robertson
31,600 PointsYes on both refresh and running a new session, the same error pops up.
Maciej Czuchnowski
36,441 PointsOK, the question is updated and clear, it passes (just without this last resources monkeys line in the global scope), but as other students reported, it throws a popup window with "Oh no!", doesn't update the status of the challenge and the challenge is still grey on the list of things to do in that section ;)
Kyle Robertson
31,600 PointsIs anyone having the same issue with later code challenges in this course? I'm getting the same error with the next one as well.
Jay McGavren
Treehouse TeacherIt appears the "Internal Server Error" issue is entirely separate from the original problem with this challenge. Only certain users are affected, and only for this course. We've just finished a fix and are working on getting it deployed. We'll post again when that's done.
Jay McGavren
Treehouse TeacherFix is deployed. Videos, quizzes, and code challenges for this course should now appear checked off when complete. Please contact support if you need any further help. Sorry for the trouble!
Kyle Robertson
31,600 PointsThanks Jay!
12 Answers
Maciej Czuchnowski
36,441 PointsI already contacted the Support with this, hope they'll fix it soon. Your code should definitely pass.
james white
78,399 PointsI am also having trouble with this.
Hopefully they fix it eventually.
Kyle Robertson
31,600 Pointssame here.
David Curtis
11,301 PointsGlad I am not the only one!
Maciej Czuchnowski
36,441 PointsStill not working. I wonder if there's something wrong with the challenge evaluator or if the question was supposed to be something else.
Kenan Memis
47,314 PointsIn preview under output.html there is this code initially:
b0bbc726-e841-40fe-8ac1-7f9dc27ff47e.rb:8:in `anonymous': undefined local variable or method `context' for main:Object (NameError) from b0bbc726-e841-40fe-8ac1-7f9dc27ff47e.rb:12:in `eval' from b0bbc726-e841-40fe-8ac1-7f9dc27ff47e.rb:12:in `
Gerson Lopez
13,352 Points-________-
Kyle Robertson
31,600 Pointsseems to work now if you just wrap the resources :monkeys inside the namespace and leave it out of the application level.
Rails.application.routes.draw do
namespace :gone_bananas do
resources :monkeys
end
end
Kenan Memis
47,314 PointsIt gives an internal error and seems to passed the challenge but it is not. And also this is not the true case.. They have to correct it. Support team where are you :)
Kyle Robertson
31,600 PointsAh you're right. I spoke too soon.
james white
78,399 PointsKenan and Kyle are right!
I also got "Challenge Completed", but then it pops up:
Oh no!
Internal Server Error
If you continue experiencing problems, please contact support at help@teamtreehouse.com.
..and I still didn't credit for completing the challenge.
Maybe I should get credit for QA/troubleshooting?
Everyone who has had to deal with this should get bonus points!
Elliott Roche
12,096 PointsI've got the same Internal Server Error problem even after passing all of the challenges successfully.
Jay McGavren
Treehouse TeacherApologies to the folks encountering the Internal Server Error issue - we're looking into it and will post as soon as we have a fix.
Kyle Robertson
31,600 PointsThanks Jay, it happens on all the quizzes and code challenges after this one as well, and videos aren't marked as complete on my end after being watched.
Jay McGavren
Treehouse TeacherJay McGavren
Treehouse TeacherApologies for the difficulties with this challenge, folks. It was indeed an internal error. We believe we have it fixed now. Please let us know if you have further trouble!