Class: Bookkeeper::IncomingsController
- Inherits:
-
ApplicationController
- Object
- ActionController::Base
- ApplicationController
- Bookkeeper::IncomingsController
- Defined in:
- app/controllers/bookkeeper/incomings_controller.rb
Instance Method Summary collapse
Instance Method Details
#create ⇒ Object
13 14 15 16 17 18 19 20 21 |
# File 'app/controllers/bookkeeper/incomings_controller.rb', line 13 def create @incoming = Incoming.new(params[:incoming]) if @incoming.save redirect_to balance_index_path, notice: I18n.t('.bookkeeper.controllers.incomings.created') else render action: "new" end end |
#destroy ⇒ Object
33 34 35 36 37 38 39 |
# File 'app/controllers/bookkeeper/incomings_controller.rb', line 33 def destroy @incoming = Incoming.find(params[:id]) @incoming.destroy flash[:notice] = I18n.t('.bookkeeper.controllers.incomings.destroyed') redirect_to balance_index_path end |
#edit ⇒ Object
9 10 11 |
# File 'app/controllers/bookkeeper/incomings_controller.rb', line 9 def edit @incoming = Incoming.find(params[:id]) end |
#new ⇒ Object
5 6 7 |
# File 'app/controllers/bookkeeper/incomings_controller.rb', line 5 def new @incoming = Incoming.new end |
#update ⇒ Object
23 24 25 26 27 28 29 30 31 |
# File 'app/controllers/bookkeeper/incomings_controller.rb', line 23 def update @incoming = Incoming.find(params[:id]) if @incoming.update_attributes(params[:incoming]) redirect_to balance_index_path, notice: I18n.t('.bookkeeper.controllers.incomings.updated') else render action: "edit" end end |