Class: BarcodePrintersController
Constant Summary
FlashTruncation::STRING_OVERHEAD
Instance Method Summary
collapse
#block_api_access, #evil_parameter_hack!, #extract_header_info, #set_cache_disabled!
#max_flash_size, #truncate_flash, #truncate_flash_array
Instance Method Details
#create ⇒ Object
31
32
33
34
35
36
37
38
39
40
41
42
43
|
# File 'app/controllers/barcode_printers_controller.rb', line 31
def create
@barcode_printer = BarcodePrinter.new(params[:barcode_printer])
@barcode_printer.barcode_printer_type = BarcodePrinterType.find(params[:barcode_printer_type_id])
respond_to do |format|
if @barcode_printer.save
flash[:notice] = 'Barcode Printer was successfully created.'
format.html { redirect_to(barcode_printers_url) }
else
format.html { render action: 'new' }
end
end
end
|
#destroy ⇒ Object
59
60
61
62
63
64
|
# File 'app/controllers/barcode_printers_controller.rb', line 59
def destroy
@barcode_printer = BarcodePrinter.find(params[:id])
@barcode_printer.destroy
respond_to { |format| format.html { redirect_to(barcode_printers_url) } }
end
|
#edit ⇒ Object
27
28
29
|
# File 'app/controllers/barcode_printers_controller.rb', line 27
def edit
@barcode_printer = BarcodePrinter.find(params[:id])
end
|
#index ⇒ Object
9
10
11
12
13
|
# File 'app/controllers/barcode_printers_controller.rb', line 9
def index
@barcode_printers = BarcodePrinter.all
respond_to { |format| format.html }
end
|
#new ⇒ Object
21
22
23
24
25
|
# File 'app/controllers/barcode_printers_controller.rb', line 21
def new
@barcode_printer = BarcodePrinter.new
respond_to { |format| format.html }
end
|
#show ⇒ Object
15
16
17
18
19
|
# File 'app/controllers/barcode_printers_controller.rb', line 15
def show
@barcode_printer = BarcodePrinter.find(params[:id])
respond_to { |format| format.html }
end
|
#update ⇒ Object
rubocop:todo Metrics/AbcSize
45
46
47
48
49
50
51
52
53
54
55
56
57
|
# File 'app/controllers/barcode_printers_controller.rb', line 45
def update @barcode_printer = BarcodePrinter.find(params[:id])
@barcode_printer.barcode_printer_type = BarcodePrinterType.find(params[:barcode_printer_type_id])
respond_to do |format|
if @barcode_printer.update(params[:barcode_printer])
flash[:notice] = 'Barcode Printer was successfully updated.'
format.html { redirect_to(barcode_printers_url) }
else
format.html { render action: 'edit' }
end
end
end
|