I launched a new rails 4 application and want to use it as an API. So this is what I got:
app/controllers/api/v1/teams_controller.rb:
module Api
module V1
class TeamsController < ApplicationController
...
def show
@team = Team.find(params[:id])
end
...
end
end
end
app/views/api/v1/teams/show.json.jbuilder:
team ||= @team
json.id team['id']
json.name team['name']
and I get a blank page.
However, when I add render json: @teamto the method show, it gets rendered normally.
Does anyone have an idea what happened to JBuilder?
source
share