tap/app/controllers/barcodes_controller.rb

16 lines
334 B
Ruby
Raw Normal View History

class BarcodesController < ApplicationController
load_resource :product
load_and_authorize_resource :barcode, through: :product
def create
@barcode.save
2015-09-26 11:57:41 +02:00
redirect_to barcode_products_path, notice: "Barcode successfully linked!"
end
private
def barcode_params
params.require(:barcode).permit(:code)
end
end