Sha256: a220fa3c2e87191e54ebc9308180439de73e218e99989da9e358318ef1ed6df7

Contents?: true

Size: 1023 Bytes

Versions: 1

Compression:

Stored size: 1023 Bytes

Contents

module AssetHostCore
  module Admin
    class OutputsController < BaseController
      layout 'asset_host_core/full_width'

      before_filter :authorize_admin
      before_filter :get_output, except: [:index, :new, :create]


      def index
        @outputs = Output.all
      end


      def update
        if @output.update_attributes(params[:output])
          flash[:notice] = "Updated Output."
          redirect_to a_outputs_path
        else
          render :edit
        end
      end


      def new
        @output = Output.new
      end


      def create
        @output = Output.new(params[:output])

        if @output.save
          flash[:notice] = "Created Output."
          redirect_to a_outputs_path
        else
          render :new
        end
      end


      def destroy
        @output.destroy
        flash[:notice] = "Destroyed Output."
        redirect_to a_outputs_path
      end

      private

      def get_output
        @output = Output.find(params[:id])
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
asset_host_core-2.0.0.beta app/controllers/asset_host_core/admin/outputs_controller.rb