Kevin LozandierPro Student 53,746 Points
Challenge missing API reference to `as_json`; important since it's not discovered in the videos leading to it
In the "Returning JSON" challenge immediately after the Better JSON Messages, it's missing providing students references to how
Unless you're familiar with Rails APIs concerning returning JSON in controllers, it's currently unnecessarily difficult for students completely unfamiliar with generating Rails API to pass this challenge without a reference to
as_json API, particularly its parameters.
Unless Naomi Freeman differs, it seems the challenge is best appended to include documentation or provide a few examples for course takers completely unfamiliar with designing APIs using Rails to complete the challenge.
It'd also be a good opportunity for students to get used to the docs—Rails having one of the most newbie-friendly documentation on the internet.
class MonkeysController < ApplicationController before_filter :find_monkey def show render json: @monkey.as_json(include: :bananas) end private def find_monkey @monkey = Monkey.find(params[:id]) end end
Edit: Treehouse's modal system seemingly didn't understand how to scrape my answer properly that's the definitive answer to the challenge based on a priori knowledge of Rails controllers and the challenge accepting it
Maciej Czuchnowski36,427 Points
The relevant video is there, a bit later in the section.
J VPro Student 16,607 Points
Actually Kevin its aright for you to be unaware.
I noticed the past couple of days that the forum isn't updating correctly after a refresh or when rendering the page from another location. Had it been updating properly, I would have checked other topics before I posted my question about as_json...
Then you guys started talking about how this forum was over run with 'tons of api-question overload.'
I was a bit bewildered because I didn't see any topics at all about the issue.
Only yesterday did I see what you were seeing.
The forum seems to be stuck on some topics from days ago, or it will set me back half a day, because I notice that my points are suddenly substantially lower whenever I enter the ruby forum. lol. I have to refresh several times before it updates, and even if I clear my cache..