実装したいこと
jsonデータ形式にすること
修正前
def index
@cooks = Cook.all
render json:@cooks
end
結果、jsonデータ形式をしたい場所が、indexではないため、変化なし
修正後
def show
@cook = Cook.find(params[:id])
render json:@cook
end
結果、json形式できた
Go to list of users who liked
More than 3 years have passed since last update.
実装したいこと
jsonデータ形式にすること
修正前
def index
@cooks = Cook.all
render json:@cooks
end
結果、jsonデータ形式をしたい場所が、indexではないため、変化なし
修正後
def show
@cook = Cook.find(params[:id])
render json:@cook
end
結果、json形式できた
Register as a new user and use Qiita more conveniently
Go to list of users who liked