2015-09-25 14:24:32 +02:00
|
|
|
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!"
|
2015-09-25 14:24:32 +02:00
|
|
|
end
|
|
|
|
|
|
|
|
private
|
|
|
|
|
|
|
|
def barcode_params
|
|
|
|
params.require(:barcode).permit(:code)
|
|
|
|
end
|
|
|
|
end
|