Class: Bookkeeper::OutgoingsController
- Inherits:
-
ApplicationController
- Object
- ActionController::Base
- ApplicationController
- Bookkeeper::OutgoingsController
- Defined in:
- app/controllers/bookkeeper/outgoings_controller.rb
Instance Method Summary collapse
Instance Method Details
#create ⇒ Object
13 14 15 16 17 18 19 20 21 |
# File 'app/controllers/bookkeeper/outgoings_controller.rb', line 13 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 |
#destroy ⇒ Object
33 34 35 36 37 38 39 |
# File 'app/controllers/bookkeeper/outgoings_controller.rb', line 33 def destroy @outgoing = Outgoing.find(params[:id]) @outgoing.destroy flash[:notice] = I18n.t('.bookkeeper.controllers.outgoings.destroyed') redirect_to balance_index_path end |
#edit ⇒ Object
9 10 11 |
# File 'app/controllers/bookkeeper/outgoings_controller.rb', line 9 def edit @outgoing = Outgoing.find(params[:id]) end |
#new ⇒ Object
5 6 7 |
# File 'app/controllers/bookkeeper/outgoings_controller.rb', line 5 def new @outgoing = Outgoing.new end |
#update ⇒ Object
23 24 25 26 27 28 29 30 31 |
# File 'app/controllers/bookkeeper/outgoings_controller.rb', line 23 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 |