Sha256: 43e8d45e1bb2ab1a3d146fcf7f72d1083f1a24959bac69e174edfda5a6d83c39

Contents?: true

Size: 1.43 KB

Versions: 6

Compression:

Stored size: 1.43 KB

Contents

module Ctws
  class MinAppVersionsController < CtwsController
    skip_before_action :authorize_request, only: [:min_app_version]
    before_action :set_min_app_version, only: [:show, :update, :destroy]

    # GET /min_app_version
    def min_app_version
      min_app_versions = []
      MinAppVersion.group(:platform).each do |platform|
        min_app_versions << platform.as_jsonapi
      end
      json_response min_app_versions
    end
    
    # GET /min_app_versions
    def index
      json_response MinAppVersion.all
    end

    # GET /min_app_versions/1
    def show
      json_response @min_app_version.as_jsonapi
    end

    # POST /min_app_versions
    def create
      @min_app_version = MinAppVersion.create!(min_app_version_params)
      json_response @min_app_version, :created
    end

    # PATCH/PUT /min_app_versions/1
    def update
      @min_app_version.update(min_app_version_params)
      head :no_content
    end

    # DELETE /min_app_versions/1
    def destroy
      @min_app_version.destroy
      head :no_content
    end

    private
      # Use callbacks to share common setup or constraints between actions.
      def set_min_app_version
        @min_app_version = MinAppVersion.find(params[:id])
      end

      # Only allow a trusted parameter "white list" through.
      def min_app_version_params
        params.require(:min_app_version).permit(:codename, :description, :platform, :min_version, :store_uri)
      end
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
ctws-0.1.10.alpha app/controllers/ctws/min_app_versions_controller.rb
ctws-0.1.9.alpha app/controllers/ctws/min_app_versions_controller.rb
ctws-0.1.8.alpha app/controllers/ctws/min_app_versions_controller.rb
ctws-0.1.7.alpha app/controllers/ctws/min_app_versions_controller.rb
ctws-0.1.6.alpha app/controllers/ctws/min_app_versions_controller.rb
ctws-0.1.5.alpha app/controllers/ctws/min_app_versions_controller.rb