Class: Gemgento::StockNotificationsController

Inherits:
ApplicationController show all
Defined in:
app/controllers/gemgento/stock_notifications_controller.rb

Instance Method Summary collapse

Instance Method Details

#createObject



5
6
7
8
9
10
11
12
13
# File 'app/controllers/gemgento/stock_notifications_controller.rb', line 5

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