Class: Crm::Items::CustomMatsController
- Inherits:
-
CrmController
- Object
- CrmController
- Crm::Items::CustomMatsController
- Defined in:
- app/controllers/crm/items/custom_mats_controller.rb
Overview
Controller: custom mats.
Instance Method Summary collapse
-
#create ⇒ Object
Creates a custom mat item from
custom_mat_params. -
#new ⇒ Object
Renders the form for a new custom mat item.
Instance Method Details
#create ⇒ Object
Creates a custom mat item from custom_mat_params.
11 12 13 14 15 16 17 18 19 20 21 |
# File 'app/controllers/crm/items/custom_mats_controller.rb', line 11 def create (:create, Item) @custom_mat = Item::CustomMatCreator.new(custom_mat_params) if (@item = @custom_mat.save) flash[:info] = "Custom mat item #{@item.sku} has been created." redirect_to @item else render action: 'new', status: :unprocessable_content end end |
#new ⇒ Object
Renders the form for a new custom mat item.
5 6 7 8 |
# File 'app/controllers/crm/items/custom_mats_controller.rb', line 5 def new (:create, Item) @custom_mat = Item::CustomMatCreator.new end |