Sha256: deeca845fa6179254ccb9c3b231ef4e11a9c637a3a5eea1d17f5f98dd6dbd1e4

Contents?: true

Size: 821 Bytes

Versions: 2

Compression:

Stored size: 821 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

2 entries across 2 versions & 1 rubygems

Version Path
apipie-rails-1.4.2 spec/dummy/app/controllers/sample_controller.rb
apipie-rails-1.4.1 spec/dummy/app/controllers/sample_controller.rb