Class: Dorsale::BillingMachine::PaymentTermsController
- Inherits:
-
ApplicationController
- Object
- ApplicationController
- ApplicationController
- ApplicationController
- Dorsale::BillingMachine::PaymentTermsController
- Defined in:
- app/controllers/dorsale/billing_machine/payment_terms_controller.rb
Instance Method Summary collapse
Methods inherited from ApplicationController
Instance Method Details
#create ⇒ Object
16 17 18 19 20 21 22 23 24 25 26 27 |
# File 'app/controllers/dorsale/billing_machine/payment_terms_controller.rb', line 16 def create @payment_term ||= scope.new(payment_term_params_for_create) @payment_term, :create? if @payment_term.save flash[:notice] = t("payment_terms.create_ok") redirect_to back_url else render action: :new end end |
#edit ⇒ Object
29 30 31 |
# File 'app/controllers/dorsale/billing_machine/payment_terms_controller.rb', line 29 def edit @payment_term, :update? end |
#index ⇒ Object
4 5 6 7 8 |
# File 'app/controllers/dorsale/billing_machine/payment_terms_controller.rb', line 4 def index model, :list? @payment_terms ||= scope.all end |
#new ⇒ Object
10 11 12 13 14 |
# File 'app/controllers/dorsale/billing_machine/payment_terms_controller.rb', line 10 def new @payment_term ||= scope.new @payment_term, :create? end |
#update ⇒ Object
33 34 35 36 37 38 39 40 41 42 |
# File 'app/controllers/dorsale/billing_machine/payment_terms_controller.rb', line 33 def update @payment_term, :update? if @payment_term.update(payment_term_params_for_update) flash[:notice] = t("payment_terms.update_ok") redirect_to back_url else render action: :edit end end |