Sha256: 0180342e0de20c43da066d86bb67f8ba58fefcb1f96c8e3664f8bccc1915cc98

Contents?: true

Size: 887 Bytes

Versions: 16

Compression:

Stored size: 887 Bytes

Contents

  module SampleController
    extend Apipie::DSL::Concern

    api!
    def index
      render :plain => "OK #{params.inspect}"
    end

    api :GET, '/:resource_id/:id'
    param :id, String
    def show
      render :plain => "OK #{params.inspect}"
    end

    def_param_group :concern do
      param :concern, Hash, :required => true, :action_aware => true do
        param :name, String, "Name of a :concern"
        param :concern_type, String
      end
    end

    api :POST, '/:resource_id', "Create a :concern"
    param_group :concern
    def create
      render :plain => "OK #{params.inspect}"
    end

    api :PUT, '/:resource_id/:id'
    param :id, String
    param_group :concern
    def update
      render :plain => "OK #{params.inspect}"
    end

    api :GET, '/:resource_id/:custom_subst'
    def custom
      render :plain => "OK #{params.inspect}"
    end
  end

Version data entries

16 entries across 16 versions & 1 rubygems

Version Path
apipie-rails-1.4.0 spec/dummy/app/controllers/sample_controller.rb
apipie-rails-1.3.0 spec/dummy/app/controllers/sample_controller.rb
apipie-rails-1.2.3 spec/dummy/app/controllers/sample_controller.rb
apipie-rails-1.2.2 spec/dummy/app/controllers/sample_controller.rb
apipie-rails-1.2.1 spec/dummy/app/controllers/sample_controller.rb
apipie-rails-1.2.0 spec/dummy/app/controllers/sample_controller.rb
apipie-rails-1.1.0 spec/dummy/app/controllers/sample_controller.rb
apipie-rails-1.0.0 spec/dummy/app/controllers/sample_controller.rb
apipie-rails-0.9.4 spec/dummy/app/controllers/sample_controller.rb
apipie-rails-0.9.3 spec/dummy/app/controllers/sample_controller.rb
apipie-rails-0.9.2 spec/dummy/app/controllers/sample_controller.rb
apipie-rails-0.9.1 spec/dummy/app/controllers/sample_controller.rb
apipie-rails-0.9.0 spec/dummy/app/controllers/sample_controller.rb
apipie-rails-0.8.2 spec/dummy/app/controllers/sample_controller.rb
apipie-rails-0.8.1 spec/dummy/app/controllers/sample_controller.rb
apipie-rails-0.8.0 spec/dummy/app/controllers/sample_controller.rb