Sha256: 7632146e123051b76c2f7ccb63c0ca4847739253f6bd7889f42e7f9543029c96

Contents?: true

Size: 559 Bytes

Versions: 1

Compression:

Stored size: 559 Bytes

Contents

module Gemgento
  class StockNotificationsController < ApplicationController
    respond_to :json

    def create
      @stock_notification = StockNotification.create(stock_notification_params)

      if @stock_notification.save
        render json: @stock_notification
      else
        render json: { errors: @stock_notification.errors }, status:  422
      end
    end

    private

    def stock_notification_params
      params.require(:stock_notification).permit(:id, :email, :name, :phone, :product_id, :product_name, :product_url)
    end

  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
gemgento-2.8.0 app/controllers/gemgento/stock_notifications_controller.rb