Sha256: 0a2d1ab1af0a7095b386e23bd98b758b89cf476c8dfdce80d9bfd31a07a246c0

Contents?: true

Size: 989 Bytes

Versions: 2

Compression:

Stored size: 989 Bytes

Contents

require_dependency "bookkeeper/application_controller"

module Bookkeeper
  class OutgoingsController < ApplicationController
    def new
      @outgoing = Outgoing.new
    end

    def edit
      @outgoing = Outgoing.find(params[:id])
    end

    def create
      @outgoing = Outgoing.new(params[:outgoing])

      if @outgoing.save
        redirect_to balance_index_path, notice: I18n.t('.bookkeeper.controllers.outgoings.created')
      else
        render action: "new"
      end
    end

    def update
      @outgoing = Outgoing.find(params[:id])

      if @outgoing.update_attributes(params[:outgoing])
        redirect_to balance_index_path, notice: I18n.t('.bookkeeper.controllers.outgoings.updated')
      else
        render action: "edit"
      end
    end

    def destroy
      @outgoing = Outgoing.find(params[:id])
      @outgoing.destroy
      flash[:notice] = I18n.t('.bookkeeper.controllers.outgoings.destroyed')

      redirect_to balance_index_path
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
bookkeeper-0.0.7 app/controllers/bookkeeper/outgoings_controller.rb
bookkeeper-0.0.6 app/controllers/bookkeeper/outgoings_controller.rb