LoginSignup
0
0

More than 1 year has passed since last update.

絶対はずさないお店を検索できるwebアプリケーションをリリースするまで②

Posted at

実装したいこと
jsonデータ形式にすること

修正前

def index
    @cooks = Cook.all
    render json:@cooks
end

結果、jsonデータ形式をしたい場所が、indexではないため、変化なし

修正後

def show
    @cook = Cook.find(params[:id])
    render json:@cook
end

結果、json形式できた

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0