Class: Crm::Items::CustomMatsController
- Inherits:
-
CrmController
- Object
- CrmController
- Crm::Items::CustomMatsController
- Defined in:
- app/controllers/crm/items/custom_mats_controller.rb
Instance Method Summary collapse
Instance Method Details
#create ⇒ Object
7 8 9 10 11 12 13 14 15 16 17 |
# File 'app/controllers/crm/items/custom_mats_controller.rb', line 7 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_entity end end |
#new ⇒ Object
2 3 4 5 |
# File 'app/controllers/crm/items/custom_mats_controller.rb', line 2 def new (:create, Item) @custom_mat = Item::CustomMatCreator.new end |