Class: Dorsale::BillingMachine::IdCardsController
- Inherits:
-
ApplicationController
- Object
- ApplicationController
- ApplicationController
- ApplicationController
- Dorsale::BillingMachine::IdCardsController
- Defined in:
- app/controllers/dorsale/billing_machine/id_cards_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/id_cards_controller.rb', line 16 def create @id_card ||= scope.new(id_card_params_for_create) @id_card, :create? if @id_card.save flash[:notice] = t("id_cards.create_ok") redirect_to back_url else render action: :new end end |
#edit ⇒ Object
29 30 31 |
# File 'app/controllers/dorsale/billing_machine/id_cards_controller.rb', line 29 def edit @id_card, :update? end |
#index ⇒ Object
4 5 6 7 8 |
# File 'app/controllers/dorsale/billing_machine/id_cards_controller.rb', line 4 def index model, :list? @id_cards ||= scope.all end |
#new ⇒ Object
10 11 12 13 14 |
# File 'app/controllers/dorsale/billing_machine/id_cards_controller.rb', line 10 def new @id_card ||= scope.new @id_card, :create? end |
#update ⇒ Object
33 34 35 36 37 38 39 40 41 42 |
# File 'app/controllers/dorsale/billing_machine/id_cards_controller.rb', line 33 def update @id_card, :update? if @id_card.update(id_card_params_for_update) flash[:notice] = t("id_cards.update_ok") redirect_to back_url else render action: :edit end end |