Sha256: e6a7254af19f6797922ec0cd09ce33e3bb2b29bb75d2bc057b57f7b3d4df0c88

Contents?: true

Size: 608 Bytes

Versions: 177

Compression:

Stored size: 608 Bytes

Contents

# frozen_string_literal: true

module Motor
  class ResourcesController < ApiBaseController
    wrap_parameters :data, except: %i[include fields]

    load_and_authorize_resource

    def index
      render json: { data: Motor::ApiQuery::BuildJson.call(@resources, params, current_ability) }
    end

    def create
      Motor::Resources::PersistConfigs.call(@resource)
      Motor::Configs::WriteToFile.call

      render json: { data: Motor::ApiQuery::BuildJson.call(@resource, params, current_ability) }
    end

    private

    def resource_params
      params.require(:data).permit!
    end
  end
end

Version data entries

177 entries across 177 versions & 7 rubygems

Version Path
motor-admin-0.4.34 app/controllers/motor/resources_controller.rb
motor-admin-0.4.33 app/controllers/motor/resources_controller.rb
motor-admin-0.4.32 app/controllers/motor/resources_controller.rb
motor-admin-0.4.31 app/controllers/motor/resources_controller.rb
motor-admin-0.4.30 app/controllers/motor/resources_controller.rb
motor-admin-0.4.29 app/controllers/motor/resources_controller.rb
motor-admin-0.4.28 app/controllers/motor/resources_controller.rb
motor-admin-cstham8-0.4.35 app/controllers/motor/resources_controller.rb
motor-admin-cstham8-0.4.34 app/controllers/motor/resources_controller.rb
motor-admin-cstham8-0.4.33 app/controllers/motor/resources_controller.rb
motor-admin-cstham8-0.4.32 app/controllers/motor/resources_controller.rb
motor-admin-cstham8-0.4.31 app/controllers/motor/resources_controller.rb
motor-admin-cstham8-0.4.30 app/controllers/motor/resources_controller.rb
motor-admin-cstham8-0.4.29 app/controllers/motor/resources_controller.rb
motor-admin-cstham8-0.4.28 app/controllers/motor/resources_controller.rb
motor-admin-cstham8-0.4.27 app/controllers/motor/resources_controller.rb
motor-admin-0.4.27 app/controllers/motor/resources_controller.rb
motor-admin-unosquare-0.4.28 app/controllers/motor/resources_controller.rb
motor-admin-unosquare-0.4.27 app/controllers/motor/resources_controller.rb
motor-admin-pz-0.4.26 app/controllers/motor/resources_controller.rb