Sha256: a005e8ddcaa1f6ca41310bdb7076d78db9092ca22ad4e1bd476dfb96752f2876

Contents?: true

Size: 609 Bytes

Versions: 2

Compression:

Stored size: 609 Bytes

Contents

module MakeRestful::RestMethods

  ####################################
  ## RESTful Methods
  ####################################

  # GET /resources
  # Verified by :list
  def index
  end

  # POST /resources
  # Verified by :create
  def create
    @instance = @resource.create
  end

  # GET /resources/:id
  def show
  end

  # PUT /resources/:id
  def update
    @instance.update_attributes(params[@resource.to_s.underscore])
  end

  # DELETE /resources/:id
  def destroy
    @response = { success: @instance.destroy }
  end

  # OPTIONS /resources
  def spec
    @response = specification
  end

end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
make_restful-0.1.3 lib/make_restful/rest_methods.rb
make_restful-0.1.2 lib/make_restful/rest_methods.rb