Sha256: e7b63af0b9760f36b2e426b72601b7eaea63a029ef2beb6018ee78640f9a0cad

Contents?: true

Size: 633 Bytes

Versions: 2

Compression:

Stored size: 633 Bytes

Contents

module Ponytail
  class SchemasController < ActionController::Base
    respond_to :json, only: [:show, :update]

    def show
      @schema = Schema.new
      respond_with @schema
    end

    def update
      # TODO, WIP:
      @schema = Schema.new
      if @schema.update(schema_params)
        flash[:notice] = "Schema was successfully updated."
        render json: @schema, status: :ok
      else
        flash[:notice] = "Schema update was failed."
        render json: @schema, status: :bad_request
      end
    end

    private
    def schema_params
      params.require(:ponytail_schema).permit(:version)
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
ponytail-0.6.0 app/controllers/ponytail/schemas_controller.rb
ponytail-0.5.0 app/controllers/ponytail/schemas_controller.rb