Rails API in Rails 5

Embed Size (px)

Text of Rails API in Rails 5

  • RailsAPI in Rails 5

    .rb #2Sansan (@yonda)

  • Sansan

    github : yonda

    :

  • .rb

  • Rails 5 Rails API

  • Rails API

  • Rails-API

    Rails 5 rails-api Gem Rails

    API scaffold

  • Usage

    $ rails new --api

  • rails new

  • Gemfile

    API Gem jbuilder active_model_serializers

  • Gemfile

  • jbuilder AMS

    rails-api PR PR

    :bow: rails-api gem AMS json-api AMS view

    partial array object render AMS

  • config/application.rb

    config.api_only = true

    scaffold

  • rails g scaffold

    controller json

  • Web View edit new

  • Controller

  • Serializer

  • API Rails

    API AMS (AMS ) jbuilder

    jbuilder AMS

    view serializer