|
|
|
@@ -44,6 +44,10 @@ class ProductsController < ApplicationController |
|
|
|
if @product.update(product_params) |
|
|
|
format.html { redirect_to @product, notice: 'Product was successfully updated.' } |
|
|
|
format.json { render :show, status: :ok, location: @product } |
|
|
|
|
|
|
|
@products = Product.all |
|
|
|
ActionCable.server.broadcast 'products', |
|
|
|
html: render_to_string('store/index', layout: false) |
|
|
|
else |
|
|
|
format.html { render :edit } |
|
|
|
format.json { render json: @product.errors, status: :unprocessable_entity } |
|
|
|
|