Sha256: 6e78387ae7dda2d2c9ba8c2d2c0b469bf0b601d39b34745cb97148ddcb5b4d69

Contents?: true

Size: 790 Bytes

Versions: 2

Compression:

Stored size: 790 Bytes

Contents

# frozen_string_literal: true

require_dependency 'distribuo/application_admin_controller'

module Distribuo
  module Admin
    class AppsController < ApplicationAdminController
      before_action :set_objects, except: [:index]

      def new
        render :edit
      end

      def create
        authorize @app
        @app.update(permitted_attributes(@app))
        respond_with @app, action: :index
      end

      def show
        render :edit
      end

      def edit; end

      def update
        authorize @app
        @app.update(permitted_attributes(@app))
        respond_with @app, action: :index
      end

      private

      def set_objects
        @app = Distribuo::App.find(params[:id]) if params[:id]
        @app ||= Distribuo::App.new
      end
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
distribuo-0.1.16 app/controllers/distribuo/admin/apps_controller.rb
distribuo-0.1.8 app/controllers/distribuo/admin/apps_controller.rb