Class: BarcodePrintersController

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

Instance Method Summary collapse

Methods inherited from ApplicationController

#block_api_access, #clean_params_from_check, #evil_parameter_hack!, #extract_header_info, #set_cache_disabled!

Instance Method Details

#createObject


36
37
38
39
40
41
42
43
44
45
46
47
48
# File 'app/controllers/barcode_printers_controller.rb', line 36

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

#destroyObject


64
65
66
67
68
69
70
71
# File 'app/controllers/barcode_printers_controller.rb', line 64

def destroy
  @barcode_printer = BarcodePrinter.find(params[:id])
  @barcode_printer.destroy

  respond_to do |format|
    format.html { redirect_to(barcode_printers_url) }
  end
end

#editObject


32
33
34
# File 'app/controllers/barcode_printers_controller.rb', line 32

def edit
  @barcode_printer = BarcodePrinter.find(params[:id])
end

#indexObject


8
9
10
11
12
13
14
# File 'app/controllers/barcode_printers_controller.rb', line 8

def index
  @barcode_printers = BarcodePrinter.all

  respond_to do |format|
    format.html
  end
end

#newObject


24
25
26
27
28
29
30
# File 'app/controllers/barcode_printers_controller.rb', line 24

def new
  @barcode_printer = BarcodePrinter.new

  respond_to do |format|
    format.html
  end
end

#showObject


16
17
18
19
20
21
22
# File 'app/controllers/barcode_printers_controller.rb', line 16

def show
  @barcode_printer = BarcodePrinter.find(params[:id])

  respond_to do |format|
    format.html
  end
end

#updateObject


50
51
52
53
54
55
56
57
58
59
60
61
62
# File 'app/controllers/barcode_printers_controller.rb', line 50

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