Upgrade to Pro — share decks privately, control downloads, hide ads and more …

おいしい時間を支えるAPI設計 / Food Service Engineers Meetup #3

taogawa
June 14, 2017

おいしい時間を支えるAPI設計 / Food Service Engineers Meetup #3

2017/6/14 「Food Service Engineers Meetup #3 〜メキシカンナイト〜」での発表スライドです

taogawa

June 14, 2017
Tweet

More Decks by taogawa

Other Decks in Programming

Transcript

  1. ෆඞཁͳ߲໨͕ଟ͍ render json: @user.as_json # => response # { #

    "id": 1, # "first_name": "hike", # "last_name": "kitch", # ...ͨ͘͞Μͷ߲໨͕ଓ͘ # } • ཉ͍͠ͷ͸idͱ໊લ͚ͩͳͷʹɾɾɾ
  2. ѱ͍ྫ • ࢖ͬͯ͸͍͚ͳ͍ as_json render json: @user.as_json # => response

    # { # "id": 1, # "first_name": "hike", # "last_name": "kitch", # ... # "password_digest": "xxxxxxxxx" # !!!!! # }
  3. ςϯϓϨʔτΤϯδϯ or SerializerΛ࢖͓͏ • ςϯϓϨʔτΤϯδϯ • Rabl • jbuilder •

    Serializer • ActiveModelSerializer -> ฐࣾͰ͸͜ΕΛ࢖͍· ͨ͠
  4. after # /kitchens/:id class KitchensController < ApplicationController def show end

    end # /self/kitchens/:id class Self::KitchensController < ApplicationController def show end end