Sha256: 7bfc0d6d688db0de86977770f6033675b81721d46ad5f268372c93b19fc4cacf

Contents?: true

Size: 1 KB

Versions: 13

Compression:

Stored size: 1 KB

Contents

# frozen_string_literal: true
# author: Vadim Shaveiko <@vshaveyko>
# :nodoc:
class RailsApiDoc::ApiDocsController < RailsApiDoc::ApplicationController

  class NewRecord < ActiveRecord::Base
  end

  def index
    # preload controllers for parameters to apply
    Dir.glob("#{Rails.root}/app/controllers/**/*.rb").each { |file| require_dependency file }

    @static_data = {
      types: RailsApiDoc::Controller::Parameter::Repository::Param::ACCEPTED_TYPES.map(&:to_s)
    }

    @request_repository = RailsApiDoc::Controller::Parameter::Repository

    @response_repository = RailsApiDoc::Controller::Response.repo
  end

  def create
    attributes = RailsApiDoc::Controller::AttributeParser.parse_attributes(permitted_params)
  end

  def destroy
    pry binding
  end

  def edit
    @api_record = NewRecord.new

    pry binding
  end

  def new
    @api_record = NewRecord.new
    pry binding
  end

  def update
    pry binding
  end

  private

  def permitted_params
    params.permit!(:name, :type, :enum)
  end

end

Version data entries

13 entries across 13 versions & 1 rubygems

Version Path
rails_api_documentation-0.2.2 app/controllers/rails_api_doc/api_docs_controller.rb
rails_api_documentation-0.2.1 app/controllers/rails_api_doc/api_docs_controller.rb
rails_api_documentation-0.2.0 app/controllers/rails_api_doc/api_docs_controller.rb
rails_api_documentation-0.1.9 app/controllers/rails_api_doc/api_docs_controller.rb
rails_api_documentation-0.1.8 app/controllers/rails_api_doc/api_docs_controller.rb
rails_api_documentation-0.1.7 app/controllers/rails_api_doc/api_docs_controller.rb
rails_api_documentation-0.1.6 app/controllers/rails_api_doc/api_docs_controller.rb
rails_api_documentation-0.1.5 app/controllers/rails_api_doc/api_docs_controller.rb
rails_api_documentation-0.1.4 app/controllers/rails_api_doc/api_docs_controller.rb
rails_api_documentation-0.1.3 app/controllers/rails_api_doc/api_docs_controller.rb
rails_api_documentation-0.1.2 app/controllers/rails_api_doc/api_docs_controller.rb
rails_api_documentation-0.1.1 app/controllers/rails_api_doc/api_docs_controller.rb
rails_api_documentation-0.1.0 app/controllers/rails_api_doc/api_docs_controller.rb