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.12 app/controllers/motor/resources_controller.rb
motor-admin-0.4.11 app/controllers/motor/resources_controller.rb
motor-admin-pz-0.4.10 app/controllers/motor/resources_controller.rb
motor-admin-0.4.10 app/controllers/motor/resources_controller.rb
motor-admin-pz-0.4.9 app/controllers/motor/resources_controller.rb
motor-admin-0.4.9 app/controllers/motor/resources_controller.rb
motor-admin-0.4.8 app/controllers/motor/resources_controller.rb
motor-admin-0.4.7 app/controllers/motor/resources_controller.rb
motor-admin-0.4.6 app/controllers/motor/resources_controller.rb
motor-admin-0.4.5 app/controllers/motor/resources_controller.rb
motor-admin-0.4.4 app/controllers/motor/resources_controller.rb
motor-admin-0.4.3 app/controllers/motor/resources_controller.rb
motor-admin-0.4.2 app/controllers/motor/resources_controller.rb
motor-admin-0.4.0 app/controllers/motor/resources_controller.rb
motor-admin-0.3.17 app/controllers/motor/resources_controller.rb
motor-admin-0.3.16 app/controllers/motor/resources_controller.rb
motor-admin-0.3.15 app/controllers/motor/resources_controller.rb
mafia-admin-0.3.18 app/controllers/motor/resources_controller.rb
mafia-admin-0.3.17 app/controllers/motor/resources_controller.rb
mafia-admin-0.3.16 app/controllers/motor/resources_controller.rb